From: Vasu Kulkarni Date: Thu, 31 May 2018 17:44:40 +0000 (-0700) Subject: Add misc cleanup options before we unlock the system X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=fe42dd4dac60cb3d17402cf4ce3483ccc3514785;p=teuthology.git Add misc cleanup options before we unlock the system Signed-off-by: Vasu Kulkarni --- diff --git a/teuthology/misc.py b/teuthology/misc.py index 2969ab9974..d459637384 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -24,6 +24,7 @@ import pprint 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 @@ -1310,6 +1311,17 @@ def get_distro(ctx): 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). diff --git a/teuthology/task/internal/lock_machines.py b/teuthology/task/internal/lock_machines.py index 96b5eec632..6638ffed94 100644 --- a/teuthology/task/internal/lock_machines.py +++ b/teuthology/task/internal/lock_machines.py @@ -150,6 +150,7 @@ def lock_machines(ctx, config): 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)