From: Zack Cerza Date: Wed, 24 Aug 2016 14:35:11 +0000 (-0600) Subject: Rename _build_command() to _ipmi_command() X-Git-Tag: 1.1.0~537^2~12 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=89346c237b2b24b206f7fa5cb0ecf76e1da6a512;p=teuthology.git Rename _build_command() to _ipmi_command() Signed-off-by: Zack Cerza --- diff --git a/teuthology/orchestra/console.py b/teuthology/orchestra/console.py index e2dcd009..29ed6cf1 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 0782d133..3e24e078 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,