From 77e8d801b175c9a35593b14e2519c34b3b53f1d6 Mon Sep 17 00:00:00 2001 From: Sam Lang Date: Wed, 23 Jan 2013 16:27:32 -0600 Subject: [PATCH] Remove console.py Handling of ipmi via the console is now done through the Console class in teuthology/orchestra/remote.py. Signed-off-by: Sam Lang Reviewed-by: Josh Durgin --- teuthology/task/console.py | 64 -------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 teuthology/task/console.py diff --git a/teuthology/task/console.py b/teuthology/task/console.py deleted file mode 100644 index 01b0ef179e18f..0000000000000 --- a/teuthology/task/console.py +++ /dev/null @@ -1,64 +0,0 @@ -import contextlib -import logging -import os -import re -import subprocess - -from teuthology import misc as teuthology -from ..orchestra import run - -log = logging.getLogger(__name__) - -@contextlib.contextmanager -def task(ctx, config): - if config is None: - config = {} - for _, roles_for_host in ctx.cluster.remotes.iteritems(): - config[roles_for_host[0]] = {} - assert isinstance(config, dict) - - log.info('Console config is %s', config) - - procs = {} - if ctx.archive is not None: - path = os.path.join(ctx.archive, 'console') - os.makedirs(path) - - for role in config.iterkeys(): - # figure out ipmi host - (rem, ) = ctx.cluster.only(role).remotes.keys() - log.info(' role %s remote %s', role, rem) - match = re.search('@((plana|burnupi)\d\d)\.', rem.name); - if match: - host = match.group(1) + '.ipmi.sepia.ceph.com' - htype = match.group(2) - log.info('Attaching to console on %s', host) - subprocess.call([ - 'ipmitool', - '-I', 'lanplus', - '-U', htype + 'temp', - '-P', htype + 'temp', - '-H', host, - 'sol', 'deactivate' - ]) - procs[rem] = subprocess.Popen( - args=[ - 'ipmitool', - '-I', 'lanplus', - '-U', htype + 'temp', - '-P', htype + 'temp', - '-H', host, - 'sol', 'activate' - ], - stdout=open(os.path.join(path, host), 'w'), - stderr=open(os.devnull, 'w'), - stdin=subprocess.PIPE, - ) - - try: - yield - finally: - for rem, proc in procs.iteritems(): - log.info('Terminating %s console', rem.name) - proc.stdin.write('~.\n') - proc.wait() -- 2.39.5