]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Rename _check_credentials(); move calls
authorZack Cerza <zack@redhat.com>
Wed, 24 Aug 2016 14:44:26 +0000 (08:44 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 30 Aug 2016 16:52:18 +0000 (10:52 -0600)
It's now _check_ipmi_credentials() and is only called by _ipmi_command()

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/orchestra/console.py

index 23a532db266f8b24d6774b1ccbf92797616f40d3..5244579681768e6126df07dde8ec9488f50288c9 100644 (file)
@@ -48,18 +48,10 @@ class PhysicalConsole():
             conserver_client_found,
         ])
 
-    def _check_credentials(self):
-        if not self.has_ipmi_credentials:
-            log.error(
-                "Must set ipmi_user, ipmi_password, and ipmi_domain in " \
-                ".teuthology.yaml"
-            )
-
     def _pexpect_spawn_ipmi(self, ipmi_cmd):
         """
         Run the cmd specified using ipmitool.
         """
-        self._check_credentials()
         full_command = self._ipmi_command(ipmi_cmd)
         return self._pexpect_spawn(full_command)
 
@@ -84,6 +76,7 @@ class PhysicalConsole():
             return self._ipmi_command('sol activate')
 
     def _ipmi_command(self, subcommand):
+        self._check_ipmi_credentials()
         template = \
             'ipmitool -H {s}.{dn} -I lanplus -U {ipmiuser} -P {ipmipass} {cmd}'
         return template.format(
@@ -94,6 +87,13 @@ class PhysicalConsole():
             ipmipass=self.ipmipass,
         )
 
+    def _check_ipmi_credentials(self):
+        if not self.has_ipmi_credentials:
+            log.error(
+                "Must set ipmi_user, ipmi_password, and ipmi_domain in "
+                ".teuthology.yaml"
+            )
+
     def _exit_session(self, child, timeout=None):
         child.send('~.')
         t = timeout or self.timeout
@@ -251,7 +251,6 @@ class PhysicalConsole():
 
         :returns: a subprocess.Popen object
         """
-        self._check_credentials()
         ipmi_cmd = self._ipmi_command('sol activate')
         pexpect_templ = \
             "import pexpect; " \