]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
get_package_version(): return V-R for rpm
authorZack Cerza <zack@redhat.com>
Thu, 8 Sep 2016 14:43:08 +0000 (08:43 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 4 Oct 2016 15:01:20 +0000 (09:01 -0600)
Even though strictly speaking "version" implies just the %{VERSION}
field, that is hardly ever useful on its own.

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/packaging.py
teuthology/test/test_packaging.py

index ce3ca9a7878c66a555f1c608f5d27cab59d6cc1c..e3230944955d76e9b6c7bf22b63f6b4b71ac0f6a 100644 (file)
@@ -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(),
         )
index 94656e8ac717c7a62b88b19fe21fde946ab753b3..c54f0926dc0bc63dd0e709c2e6ebe7dcc6f1f223 100644 (file)
@@ -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):