From: Zack Cerza Date: Thu, 8 Sep 2016 14:43:08 +0000 (-0600) Subject: get_package_version(): return V-R for rpm X-Git-Tag: 1.1.0~522^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4d2c0b6ff076c3ebbf4635393d15614aad37b77b;p=teuthology.git get_package_version(): return V-R for rpm Even though strictly speaking "version" implies just the %{VERSION} field, that is hardly ever useful on its own. Signed-off-by: Zack Cerza --- diff --git a/teuthology/packaging.py b/teuthology/packaging.py index ce3ca9a78..e32309449 100644 --- a/teuthology/packaging.py +++ b/teuthology/packaging.py @@ -350,7 +350,7 @@ def get_package_version(remote, package): else: proc = remote.run( args=[ - 'rpm', '-q', package, '--qf', '%{VERSION}' + 'rpm', '-q', package, '--qf', '%{VERSION}-%{RELEASE}' ], stdout=StringIO(), ) diff --git a/teuthology/test/test_packaging.py b/teuthology/test/test_packaging.py index 94656e8ac..c54f0926d 100644 --- a/teuthology/test/test_packaging.py +++ b/teuthology/test/test_packaging.py @@ -247,7 +247,7 @@ class TestPackaging(object): remote.os.package_type = "rpm" packaging.get_package_version(remote, "httpd") args, kwargs = remote.run.call_args - expected_args = ['rpm', '-q', 'httpd', '--qf', '%{VERSION}'] + expected_args = ['rpm', '-q', 'httpd', '--qf', '%{VERSION}-%{RELEASE}'] assert expected_args == kwargs['args'] def test_get_package_version_not_found(self):