from netaddr.strategy.ipv4 import valid_str as _is_ipv4
from netaddr.strategy.ipv6 import valid_str as _is_ipv6
from teuthology import safepath
+from teuthology.parallel import parallel
from teuthology.exceptions import (CommandCrashedError, CommandFailedError,
ConnectionLostError)
from .orchestra import run
return os_type or "ubuntu"
+def cleanup(ctx):
+ unregister_rhel_systems(ctx)
+
+
+def unregister_rhel_systems(ctx):
+ with parallel():
+ for remote in ctx.cluster.remotes.iterkeys():
+ if remote.os.name == 'rhel':
+ remote.run(args=['sudo', 'subscription-manager', 'unregister'])
+
+
def get_distro_version(ctx):
"""
Get the verstion of the distro that we are using (release number).
finally:
# If both unlock_on_failure and nuke-on-error are set, don't unlock now
# because we're just going to nuke (and unlock) later.
+ misc.cleanup(ctx)
unlock_on_failure = (
ctx.config.get('unlock_on_failure', False)
and not ctx.config.get('nuke-on-error', False)