Skip to content

Commit

Permalink
Fix opensuse provisioning support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roman Grigoryev authored and RomanGrigorev committed Jan 17, 2020
1 parent 72ef72f commit b31a085
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
20 changes: 12 additions & 8 deletions teuthology/nuke/actions.py
Expand Up @@ -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
Expand All @@ -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(
Expand Down Expand Up @@ -340,7 +345,6 @@ def remove_ceph_data(ctx):
run.Raw('/var/run/ceph*'),
],
)
install_task.purge_data(ctx)


def remove_testing_tree(ctx):
Expand Down
3 changes: 2 additions & 1 deletion teuthology/orchestra/remote.py
Expand Up @@ -292,7 +292,8 @@ def chcon(self, file_path, context):
: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
Expand Down
4 changes: 4 additions & 0 deletions teuthology/task/selinux.py
Expand Up @@ -53,6 +53,10 @@ def filter_hosts(self):
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:
Expand Down

0 comments on commit b31a085

Please sign in to comment.