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 Dec 4, 2019
1 parent e749e7b commit d9265e4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
28 changes: 20 additions & 8 deletions teuthology/nuke/actions.py
Original file line number Diff line number Diff line change
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,26 @@ 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.run(
args=['sudo', 'zypper', 'clean']
)
log.info('Remove any ceph packages')
remote.run(
args=['sudo', 'zypper', 'remove', '--non-interactive,', run.Raw(pkgs)],
check_status=False
)
else:
remote.run(
args=['sudo', 'yum', 'clean', 'all']
)
log.info('Remove any ceph packages')
remote.run(
args=['sudo', 'yum', 'remove', '-y', run.Raw(pkgs)],
check_status=False
)
else:
log.info("Remove any broken repos")
remote.run(
Expand Down Expand Up @@ -340,7 +353,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
Original file line number Diff line number Diff line change
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
3 changes: 3 additions & 0 deletions teuthology/task/selinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ 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}: opensuse, sle are not yet supported"
log.info(msg.format(host=remote.shortname))
elif remote.os.package_type == 'rpm':
new_cluster.add(remote, roles)
else:
Expand Down

0 comments on commit d9265e4

Please sign in to comment.