diff --git a/ironic/conductor/cleaning.py b/ironic/conductor/cleaning.py index cb801fc8c2..e3151d4b8f 100644 --- a/ironic/conductor/cleaning.py +++ b/ironic/conductor/cleaning.py @@ -49,8 +49,10 @@ def do_node_clean(task, clean_steps=None, disable_ramdisk=False): node.save() task.process_event('done') - LOG.info('Automated cleaning is disabled, node %s has been ' - 'successfully moved to AVAILABLE state.', node.uuid) + how = ('API' if node.automated_clean is False else 'configuration') + LOG.info('Automated cleaning is disabled via %(how)s, node %(node)s ' + 'has been successfully moved to AVAILABLE state', + {'how': how, 'node': node}) return # NOTE(dtantsur): this is only reachable during automated cleaning, diff --git a/ironic/conductor/utils.py b/ironic/conductor/utils.py index d3da64f0e9..115c4bee19 100644 --- a/ironic/conductor/utils.py +++ b/ironic/conductor/utils.py @@ -938,7 +938,7 @@ def notify_conductor_resume_deploy(task): notify_conductor_resume_operation(task, 'deploy') -def skip_automated_cleaning(node, log=True): +def skip_automated_cleaning(node): """Checks if node cleaning needs to be skipped for an specific node. :param node: the node to consider @@ -948,9 +948,6 @@ def skip_automated_cleaning(node, log=True): elif node.automated_clean is None: return not CONF.conductor.automated_clean else: - if log: - LOG.info("Automated cleaning is disabled via the API for " - "node %(node)s", {'node': node.uuid}) return True diff --git a/ironic/drivers/modules/deploy_utils.py b/ironic/drivers/modules/deploy_utils.py index 89258b134d..1add68cdf2 100644 --- a/ironic/drivers/modules/deploy_utils.py +++ b/ironic/drivers/modules/deploy_utils.py @@ -1465,4 +1465,4 @@ def needs_agent_ramdisk(node, mode='deploy'): # Ramdisk deploys don't need an agent, but cleaning will. Since we don't # want nodes to be stuck on deletion, require an agent when cleaning is # enabled. - return not manager_utils.skip_automated_cleaning(node, log=False) + return not manager_utils.skip_automated_cleaning(node)