Trivial: log current state when continuing cleaning

Change-Id: I02a8ed6802fffee071e94be3c0cab2382b7e60ca
This commit is contained in:
Dmitry Tantsur 2021-12-06 09:09:16 +01:00
parent e51c6b930e
commit 3e225d2cd6
2 changed files with 9 additions and 5 deletions

View File

@ -154,9 +154,9 @@ def do_next_clean_step(task, step_index, disable_ramdisk=None):
disable_ramdisk = node.driver_internal_info.get( disable_ramdisk = node.driver_internal_info.get(
'cleaning_disable_ramdisk', False) 'cleaning_disable_ramdisk', False)
LOG.info('Executing %(state)s on node %(node)s, remaining steps: ' LOG.info('Executing %(kind)s cleaning on node %(node)s, remaining steps: '
'%(steps)s', {'node': node.uuid, 'steps': steps, '%(steps)s', {'node': node.uuid, 'steps': steps,
'state': node.provision_state}) 'kind': 'manual' if manual_clean else 'automated'})
# Execute each step until we hit an async step or run out of steps # Execute each step until we hit an async step or run out of steps
for ind, step in enumerate(steps): for ind, step in enumerate(steps):

View File

@ -507,8 +507,11 @@ class HeartbeatMixin(object):
try: try:
node.touch_provisioning() node.touch_provisioning()
if not node.clean_step: if not node.clean_step:
LOG.debug('Node %s just booted to start cleaning.', kind = ('manual'
node.uuid) if node.target_provision_state == states.MANAGEABLE
else 'automated')
LOG.debug('Node %s just booted to start %s cleaning',
node.uuid, kind)
msg = _('Node failed to start the first cleaning step') msg = _('Node failed to start the first cleaning step')
# First, cache the clean steps # First, cache the clean steps
self.refresh_clean_steps(task) self.refresh_clean_steps(task)
@ -577,7 +580,8 @@ class HeartbeatMixin(object):
return return
node = task.node node = task.node
LOG.debug('Heartbeat from node %s', node.uuid) LOG.debug('Heartbeat from node %s in state %s (target state %s)',
node.uuid, node.provision_state, node.target_provision_state)
driver_internal_info = node.driver_internal_info driver_internal_info = node.driver_internal_info
driver_internal_info['agent_url'] = callback_url driver_internal_info['agent_url'] = callback_url
driver_internal_info['agent_version'] = agent_version driver_internal_info['agent_version'] = agent_version