From: Zack Cerza Date: Wed, 24 Aug 2016 14:44:26 +0000 (-0600) Subject: Rename _check_credentials(); move calls X-Git-Tag: 1.1.0~537^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e562dcbab9abb024c6618e88db5f49c6324f1b6a;p=teuthology.git Rename _check_credentials(); move calls It's now _check_ipmi_credentials() and is only called by _ipmi_command() Signed-off-by: Zack Cerza --- diff --git a/teuthology/orchestra/console.py b/teuthology/orchestra/console.py index 23a532db2..524457968 100644 --- a/teuthology/orchestra/console.py +++ b/teuthology/orchestra/console.py @@ -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; " \