]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Remove console.py
authorSam Lang <sam.lang@inktank.com>
Wed, 23 Jan 2013 22:27:32 +0000 (16:27 -0600)
committerSam Lang <sam.lang@inktank.com>
Thu, 31 Jan 2013 14:23:41 +0000 (08:23 -0600)
Handling of ipmi via the console is now done through the
Console class in teuthology/orchestra/remote.py.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
teuthology/task/console.py [deleted file]

diff --git a/teuthology/task/console.py b/teuthology/task/console.py
deleted file mode 100644 (file)
index 01b0ef1..0000000
+++ /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()