From: Roman Grigoryev Date: Wed, 27 Nov 2019 12:14:28 +0000 (+0100) Subject: Fix opensuse provisioning support X-Git-Tag: 1.1.0~164^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b31a085b05322e49e070144410347b1f976115b0;p=teuthology.git Fix opensuse provisioning support task/selinux.py, orchestra/remote.py: disable SELinux for opensuse/suse distros nuke/actions.py: added support for sle/opensuse distros Signed-off-by: Roman Grigorev --- diff --git a/teuthology/nuke/actions.py b/teuthology/nuke/actions.py index e1b166141e..9ee7da2620 100644 --- a/teuthology/nuke/actions.py +++ b/teuthology/nuke/actions.py @@ -250,6 +250,7 @@ def remove_ceph_packages(ctx): for remote in ctx.cluster.remotes.keys(): if remote.os.package_type == 'rpm': log.info("Remove any broken repos") + dist_release = remote.os.name remote.run( args=['sudo', 'rm', run.Raw("/etc/yum.repos.d/*ceph*")], check_status=False @@ -267,14 +268,18 @@ def remove_ceph_packages(ctx): check_status=False, ) remote.run( - args=['sudo', 'rpm', '--rebuilddb', run.Raw('&&'), 'yum', - 'clean', 'all'] - ) - log.info('Remove any ceph packages') - remote.run( - args=['sudo', 'yum', 'remove', '-y', run.Raw(pkgs)], - check_status=False + args=['sudo', 'rpm', '--rebuilddb'] ) + if dist_release in ['opensuse', 'sle']: + remote.sh('sudo zypper clean') + log.info('Remove any ceph packages') + remote.sh('sudo zypper remove --non-interactive', + check_status=False + ) + else: + remote.sh('sudo yum clean all') + log.info('Remove any ceph packages') + remote.sh('sudo yum remove -y', check_status=False) else: log.info("Remove any broken repos") remote.run( @@ -340,7 +345,6 @@ def remove_ceph_data(ctx): run.Raw('/var/run/ceph*'), ], ) - install_task.purge_data(ctx) def remove_testing_tree(ctx): diff --git a/teuthology/orchestra/remote.py b/teuthology/orchestra/remote.py index 3af65e2831..721d809ce0 100644 --- a/teuthology/orchestra/remote.py +++ b/teuthology/orchestra/remote.py @@ -292,7 +292,8 @@ class Remote(object): :param file_path: The path to the file :param context: The SELinux context to be used """ - if self.os.package_type != 'rpm': + if self.os.package_type != 'rpm' or \ + self.os.name in ['opensuse', 'sle']: return if teuthology.lock.query.is_vm(self.shortname): return diff --git a/teuthology/task/selinux.py b/teuthology/task/selinux.py index 01026f5e44..6884edcb76 100644 --- a/teuthology/task/selinux.py +++ b/teuthology/task/selinux.py @@ -53,6 +53,10 @@ class SELinux(Task): if remote.is_vm: msg = "Excluding {host}: VMs are not yet supported" log.info(msg.format(host=remote.shortname)) + elif remote.os.name in ['opensuse', 'sle']: + msg = "Excluding {host}: \ + SELinux is not supported for '{os}' os_type yet" + log.info(msg.format(host=remote.shortname, os=remote.os.name)) elif remote.os.package_type == 'rpm': new_cluster.add(remote, roles) else: