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-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5208da67a83dca9af69f946160bc497a41ad9b8a;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 59825bc98..278679214 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -22,6 +22,7 @@ import re import pprint from teuthology import safepath +from teuthology.parallel import parallel from teuthology.exceptions import (CommandCrashedError, CommandFailedError, ConnectionLostError) from .orchestra import run @@ -1277,6 +1278,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 96b5eec63..6638ffed9 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)