]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Fix opensuse provisioning support 1369/head
authorRoman Grigoryev <Roman_Grigoryev@seagate.com>
Wed, 27 Nov 2019 12:14:28 +0000 (13:14 +0100)
committerRoman Grigorev <rgrigorev@suse.de>
Fri, 17 Jan 2020 21:36:49 +0000 (22:36 +0100)
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 <rgrigorev@suse.de>
teuthology/nuke/actions.py
teuthology/orchestra/remote.py
teuthology/task/selinux.py

index e1b166141ebc7afab7621e096e2ff6f2c83684d3..9ee7da2620659df284410306bfc57d21bdc84a53 100644 (file)
@@ -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):
index 3af65e2831a96ad52a0e33b401deb7755205a1f9..721d809ce0972e30b7746570fbcf03059bf30741 100644 (file)
@@ -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
index 01026f5e4494ea24c86f242a0baf2801b1ff9021..6884edcb761ea39f2e4f08f3cb0bf36bae142edb 100644 (file)
@@ -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: