From: srinivasabharath Date: Wed, 13 Jan 2021 06:30:01 +0000 (-0500) Subject: task/install/redhat: Removing packages based on OS in cleanup task X-Git-Tag: 1.1.0~19^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1598%2Fhead;p=teuthology.git task/install/redhat: Removing packages based on OS in cleanup task Signed-off-by: Bharath --- diff --git a/teuthology/task/install/redhat.py b/teuthology/task/install/redhat.py index 7bf1b5ebd..511808865 100644 --- a/teuthology/task/install/redhat.py +++ b/teuthology/task/install/redhat.py @@ -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'])