]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
task/install/redhat: Removing packages based on OS in cleanup task 1598/head
authorsrinivasabharath <skanta@redhat.com>
Wed, 13 Jan 2021 06:30:01 +0000 (01:30 -0500)
committerBharath <skanta@redhat.com>
Sat, 16 Jan 2021 02:24:14 +0000 (21:24 -0500)
Signed-off-by: Bharath <skanta@redhat.com>
teuthology/task/install/redhat.py

index 7bf1b5ebd0987cf1841e3cbe84390167ba682514..5118088655fb74adeff82c6797f6a325bfee4930 100644 (file)
@@ -205,14 +205,13 @@ def uninstall_pkgs(ctx, remote, downstream_config):
     :param remote: the teuthology.orchestra.remote.Remote object
     :param downstream_config the dict object that has downstream pkg info
     """
-    rh_rpm_pkgs = downstream_config.get('pkgs').get('rpm')
-    rpm_pkgs = str.join(' ', rh_rpm_pkgs)
-
-    rh_deb_pkgs = downstream_config.get('pkgs').get('deb')
-    deb_pkgs = str.join(' ', rh_deb_pkgs)
 
     if remote.os.name == 'rhel':
-        remote.run(args=['sudo', 'yum', 'remove', run.Raw(rpm_pkgs), '-y'])
+        pkgs = downstream_config.get('pkgs').get('rpm')
+        if pkgs:
+            remote.sh(['sudo', 'yum', 'remove'] + pkgs + ['-y'])
     else:
-        remote.run(args=['sudo', 'apt-get', 'remove', run.Raw(deb_pkgs), '-y'])
+        pkgs = downstream_config.get('pkgs').get('deb') 
+        if pkgs:
+            remote.sh(['sudo', 'apt-get', 'remove'] + pkgs + ['-y'])
     remote.run(args=['sudo', 'rm', '-rf', '/var/lib/ceph'])