From: Zack Cerza Date: Tue, 16 Aug 2016 20:05:05 +0000 (-0600) Subject: Add Remote.console X-Git-Tag: 1.1.0~548^2~6 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=dab8c7d518f914c1db7451c808e719a65f54003a;p=teuthology.git Add Remote.console Signed-off-by: Zack Cerza --- diff --git a/teuthology/nuke/__init__.py b/teuthology/nuke/__init__.py index 165ed9aa41..3f8f49a85e 100644 --- a/teuthology/nuke/__init__.py +++ b/teuthology/nuke/__init__.py @@ -20,7 +20,7 @@ from ..misc import ( ) from ..openstack import OpenStack, OpenStackInstance, enforce_json_dictionary from ..orchestra import run -from ..orchestra.remote import Remote, getRemoteConsole +from ..orchestra.remote import Remote from ..parallel import parallel from ..task import install as install_task from ..task.internal import check_lock, add_remotes, connect @@ -387,11 +387,7 @@ def synch_clocks(remotes): def check_console(hostname): remote = Remote(hostname) shortname = remote.shortname - console = getRemoteConsole( - name=hostname, - ipmiuser=config['ipmi_user'], - ipmipass=config['ipmi_password'], - ipmidomain=config['ipmi_domain']) + console = remote.console cname = '{host}.{domain}'.format( host=shortname, domain=config['ipmi_domain']) diff --git a/teuthology/orchestra/remote.py b/teuthology/orchestra/remote.py index 62a9a50047..33f6aa2d51 100644 --- a/teuthology/orchestra/remote.py +++ b/teuthology/orchestra/remote.py @@ -49,7 +49,7 @@ class Remote(object): self._shortname = shortname or hostname.split('.')[0] self._host_key = host_key self.keep_alive = keep_alive - self.console = console + self._console = console self.ssh = ssh def connect(self, timeout=None): @@ -422,6 +422,12 @@ class Remote(object): node['up'] = True return node + @property + def console(self): + if not self._console: + self._console = getRemoteConsole(self.name) + return self._console + def __del__(self): if self.ssh is not None: self.ssh.close()