]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add Remote.console
authorZack Cerza <zack@redhat.com>
Tue, 16 Aug 2016 20:05:05 +0000 (14:05 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 16 Aug 2016 23:07:33 +0000 (17:07 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/nuke/__init__.py
teuthology/orchestra/remote.py

index 165ed9aa41f739ea9821a8ce14d23d2ccffd247c..3f8f49a85e3405855f7dd94a54c6c53367ea09e0 100644 (file)
@@ -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'])
index 62a9a50047810be93e44cdf6ca80ee7d7b0be96a..33f6aa2d51dd9886ea4c5dc86d7c37f7802f8a27 100644 (file)
@@ -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()