Use node.uuid directly in stop_console()

There's no need to call _parse_driver_info() to convert all
parameters, we can directly use node.uuid.

Change-Id: I88fb5901de91236c67cafb36030fe9bf46824067
This commit is contained in:
Zhenguo Niu 2015-12-09 17:47:27 +08:00
parent bfcf0b723e
commit 08c1f1d01a
3 changed files with 5 additions and 16 deletions

View File

@ -611,17 +611,12 @@ class NativeIPMIShellinaboxConsole(base.ConsoleInterface):
"""Stop the remote console session for the node.
:param task: a TaskManager instance containing the node to act on.
:raises: MissingParameterValue when required IPMI credentials or
the IPMI terminal port are missing
:raises: InvalidParameterValue when the IPMI terminal port is not
an integer.
:raises: ConsoleError if unable to stop the console process.
"""
driver_info = _parse_driver_info(task.node)
try:
console_utils.stop_shellinabox_console(driver_info['uuid'])
console_utils.stop_shellinabox_console(task.node.uuid)
finally:
password_file = _console_pwfile_path(driver_info['uuid'])
password_file = _console_pwfile_path(task.node.uuid)
utils.unlink_without_raise(password_file)
def get_console(self, task):

View File

@ -1132,15 +1132,13 @@ class IPMIShellinaboxConsole(base.ConsoleInterface):
"""Stop the remote console session for the node.
:param task: a task from TaskManager
:raises: InvalidParameterValue if required ipmi parameters are missing
:raises: ConsoleError if unable to stop the console
"""
driver_info = _parse_driver_info(task.node)
try:
console_utils.stop_shellinabox_console(driver_info['uuid'])
console_utils.stop_shellinabox_console(task.node.uuid)
finally:
utils.unlink_without_raise(
_console_pwfile_path(driver_info['uuid']))
_console_pwfile_path(task.node.uuid))
def get_console(self, task):
"""Get the type and connection information about the console."""

View File

@ -663,14 +663,10 @@ class ShellinaboxConsole(base.ConsoleInterface):
"""Stop the remote console session for the node.
:param task: a task from TaskManager
:raises: MissingParameterValue if required seamicro parameters are
missing
:raises: ConsoleError if unable to stop the console
:raises: InvalidParameterValue if required parameter are invalid.
"""
driver_info = _parse_driver_info(task.node)
console_utils.stop_shellinabox_console(driver_info['uuid'])
console_utils.stop_shellinabox_console(task.node.uuid)
def get_console(self, task):
"""Get the type and connection information about the console.