From 89346c237b2b24b206f7fa5cb0ecf76e1da6a512 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Wed, 24 Aug 2016 08:35:11 -0600 Subject: [PATCH] Rename _build_command() to _ipmi_command() Signed-off-by: Zack Cerza --- teuthology/orchestra/console.py | 8 ++++---- teuthology/orchestra/test/test_console.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/teuthology/orchestra/console.py b/teuthology/orchestra/console.py index e2dcd0096..29ed6cf18 100644 --- a/teuthology/orchestra/console.py +++ b/teuthology/orchestra/console.py @@ -60,7 +60,7 @@ class PhysicalConsole(): Run the cmd specified using ipmitool. """ self._check_credentials() - full_command = self._build_command(cmd) + full_command = self._ipmi_command(cmd) log.debug('pexpect command: %s', full_command) child = pexpect.spawn( full_command, @@ -76,9 +76,9 @@ class PhysicalConsole(): host=self.shortname, ) else: - return self._build_command('sol activate') + return self._ipmi_command('sol activate') - def _build_command(self, subcommand): + def _ipmi_command(self, subcommand): template = \ 'ipmitool -H {s}.{dn} -I lanplus -U {ipmiuser} -P {ipmipass} {cmd}' return template.format( @@ -247,7 +247,7 @@ class PhysicalConsole(): :returns: a subprocess.Popen object """ self._check_credentials() - ipmi_cmd = self._build_command('sol activate') + ipmi_cmd = self._ipmi_command('sol activate') pexpect_templ = \ "import pexpect; " \ "pexpect.run('{cmd}', logfile=file('{log}', 'w'), timeout=None)" diff --git a/teuthology/orchestra/test/test_console.py b/teuthology/orchestra/test/test_console.py index 0782d1339..3e24e0785 100644 --- a/teuthology/orchestra/test/test_console.py +++ b/teuthology/orchestra/test/test_console.py @@ -52,14 +52,14 @@ class TestPhysicalConsole(TestConsole): c='sol activate', ) - def test_build_command_ipmi(self): + def test_ipmi_command_ipmi(self): cons = self.klass( self.hostname, teuth_config.ipmi_user, teuth_config.ipmi_password, teuth_config.ipmi_domain, ) - pc_cmd = cons._build_command('power cycle') + pc_cmd = cons._ipmi_command('power cycle') assert pc_cmd == self.ipmi_cmd_templ.format( h=self.hostname, d=teuth_config.ipmi_domain, -- 2.47.3