Use node uuid in some exception log
The error log using node id in some exception log is not readable, like: 'NodeLocked: Node 16 is locked by host localhost, please retry after the current operation is completed.' Update the node id with node uuid to make it more readable. Change-Id: I83a0adcc28819c44323276d65bc038da7808efac Closes-Bug: #1537992
This commit is contained in:
@@ -1538,7 +1538,7 @@ class ConductorManager(base_manager.BaseConductorManager):
|
|||||||
raise exception.UnsupportedDriverExtension(driver=node.driver,
|
raise exception.UnsupportedDriverExtension(driver=node.driver,
|
||||||
extension='console')
|
extension='console')
|
||||||
if not node.console_enabled:
|
if not node.console_enabled:
|
||||||
raise exception.NodeConsoleNotEnabled(node=node_id)
|
raise exception.NodeConsoleNotEnabled(node=node.uuid)
|
||||||
|
|
||||||
task.driver.console.validate(task)
|
task.driver.console.validate(task)
|
||||||
return task.driver.console.get_console(task)
|
return task.driver.console.get_console(task)
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ class TaskManager(object):
|
|||||||
self.node_id)
|
self.node_id)
|
||||||
LOG.debug("Node %(node)s successfully reserved for %(purpose)s "
|
LOG.debug("Node %(node)s successfully reserved for %(purpose)s "
|
||||||
"(took %(time).2f seconds)",
|
"(took %(time).2f seconds)",
|
||||||
{'node': self.node_id, 'purpose': self._purpose,
|
{'node': self.node.uuid, 'purpose': self._purpose,
|
||||||
'time': self._debug_timer.elapsed()})
|
'time': self._debug_timer.elapsed()})
|
||||||
self._debug_timer.restart()
|
self._debug_timer.restart()
|
||||||
|
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ class Connection(api.Connection):
|
|||||||
if count != 1:
|
if count != 1:
|
||||||
# Nothing updated and node exists. Must already be
|
# Nothing updated and node exists. Must already be
|
||||||
# locked.
|
# locked.
|
||||||
raise exception.NodeLocked(node=node_id,
|
raise exception.NodeLocked(node=node.uuid,
|
||||||
host=node['reservation'])
|
host=node['reservation'])
|
||||||
return node
|
return node
|
||||||
except NoResultFound:
|
except NoResultFound:
|
||||||
@@ -239,9 +239,9 @@ class Connection(api.Connection):
|
|||||||
if count != 1:
|
if count != 1:
|
||||||
node = query.one()
|
node = query.one()
|
||||||
if node['reservation'] is None:
|
if node['reservation'] is None:
|
||||||
raise exception.NodeNotLocked(node=node_id)
|
raise exception.NodeNotLocked(node=node.uuid)
|
||||||
else:
|
else:
|
||||||
raise exception.NodeLocked(node=node_id,
|
raise exception.NodeLocked(node=node.uuid,
|
||||||
host=node['reservation'])
|
host=node['reservation'])
|
||||||
except NoResultFound:
|
except NoResultFound:
|
||||||
raise exception.NodeNotFound(node_id)
|
raise exception.NodeNotFound(node_id)
|
||||||
@@ -359,7 +359,7 @@ class Connection(api.Connection):
|
|||||||
# Prevent instance_uuid overwriting
|
# Prevent instance_uuid overwriting
|
||||||
if values.get("instance_uuid") and ref.instance_uuid:
|
if values.get("instance_uuid") and ref.instance_uuid:
|
||||||
raise exception.NodeAssociated(
|
raise exception.NodeAssociated(
|
||||||
node=node_id, instance=ref.instance_uuid)
|
node=ref.uuid, instance=ref.instance_uuid)
|
||||||
|
|
||||||
if 'provision_state' in values:
|
if 'provision_state' in values:
|
||||||
values['provision_updated_at'] = timeutils.utcnow()
|
values['provision_updated_at'] = timeutils.utcnow()
|
||||||
|
|||||||
Reference in New Issue
Block a user