From c81bd9e5c7ef7263189f69d26070cf157461c5a9 Mon Sep 17 00:00:00 2001 From: Dao Cong Tien Date: Mon, 1 Aug 2016 15:20:51 +0700 Subject: [PATCH] Minor docstring and unittests fixes for IPMIConsole This is the follow-up patch of the commit 857372a2269cdd0f8a1ae5b9e9f6e0ee193f01be. This fix follows some minor comments of Lucas and Ruby from patch set 29 at the review: https://review.openstack.org/#/c/293873/. The changes are: * Fix the docstring of the _start_console() in ipmitool.py to reflect the real parameters being passed to the method. * Fix few unittests to use self.assertFalse(.called) instead of self.assertFalse(.call_count) Change-Id: I25caa9202c8bc867973205d2bf9642064d3ba492 --- ironic/drivers/modules/ipmitool.py | 2 +- ironic/tests/unit/drivers/modules/test_ipmitool.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ironic/drivers/modules/ipmitool.py b/ironic/drivers/modules/ipmitool.py index 173c56acfe..578ea35687 100644 --- a/ironic/drivers/modules/ipmitool.py +++ b/ironic/drivers/modules/ipmitool.py @@ -1135,7 +1135,7 @@ class IPMIConsole(base.ConsoleInterface): def _start_console(self, driver_info, start_method): """Start a remote console for the node. - :param task: a task from TaskManager + :param driver_info: the parameters for accessing a node :param start_method: console_utils method to start console :raises: InvalidParameterValue if required ipmi parameters are missing :raises: PasswordFileFailedToCreate if unable to create a file diff --git a/ironic/tests/unit/drivers/modules/test_ipmitool.py b/ironic/tests/unit/drivers/modules/test_ipmitool.py index 5fd3aee6bd..1877d0c326 100644 --- a/ironic/tests/unit/drivers/modules/test_ipmitool.py +++ b/ironic/tests/unit/drivers/modules/test_ipmitool.py @@ -193,7 +193,7 @@ class IPMIToolCheckInitTestCase(base.TestCase): ipmi.TMP_DIR_CHECKED = True ipmi.IPMISocatConsole() mock_support.assert_called_with(mock.ANY) - self.assertFalse(mock_check_dir.call_count) + self.assertFalse(mock_check_dir.called) @mock.patch.object(ipmi, '_is_option_supported', autospec=True) @@ -2236,7 +2236,7 @@ class IPMIToolSocatDriverTestCase(IPMIToolDriverTestCase): mock_stop.assert_called_once_with(self.node.uuid) mock_unlink.assert_called_once_with( ipmi._console_pwfile_path(self.node.uuid)) - self.assertFalse(mock_exec_stop.call_count) + self.assertFalse(mock_exec_stop.called) @mock.patch.object(ipmi, '_exec_ipmitool', autospec=True) def test__exec_stop_console(self, mock_exec):