summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules/ansible
diff options
context:
space:
mode:
authorRaphael Glon <raphael.glon@ovh.net>2018-12-28 16:15:32 +0100
committerRaphael Glon <raphael.glon@corp.ovh.com>2019-04-08 11:10:19 +0200
commitdf5261bb349dd56ac88876e14779d244bdc0beb3 (patch)
tree84f6f5847a16e64a7b40f4c9eba38c824b206510 /ironic/drivers/modules/ansible
parentde390cc5859b40bcfbaa04510d3ecd90b0012072 (diff)
downloadironic-df5261bb349dd56ac88876e14779d244bdc0beb3.tar.gz
Ansible module: fix clean error handling
It should not be up to the driver to handle the error. The error should reach the manager. Moreover, handling the error in the driver and returning nothing caused the manager to consider the step done and go to the next one instead of interrupting the cleaning workflow Change-Id: I3825838b5507bc735d983466aa3cac0edd4dfaca Story: #2005357 Task: #30315
Diffstat (limited to 'ironic/drivers/modules/ansible')
-rw-r--r--ironic/drivers/modules/ansible/deploy.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/ironic/drivers/modules/ansible/deploy.py b/ironic/drivers/modules/ansible/deploy.py
index 3e424206b..cdd211cb8 100644
--- a/ironic/drivers/modules/ansible/deploy.py
+++ b/ironic/drivers/modules/ansible/deploy.py
@@ -526,17 +526,10 @@ class AnsibleDeploy(agent_base.HeartbeatMixin, base.DeployInterface):
LOG.debug('Starting cleaning step %(step)s on node %(node)s',
{'node': node.uuid, 'step': stepname})
step_tags = step['args'].get('tags', [])
- try:
- _run_playbook(node, playbook, extra_vars, key, tags=step_tags)
- except exception.InstanceDeployFailure as e:
- LOG.error("Ansible failed cleaning step %(step)s "
- "on node %(node)s.",
- {'node': node.uuid, 'step': stepname})
- manager_utils.cleaning_error_handler(task, six.text_type(e))
- else:
- LOG.info('Ansible completed cleaning step %(step)s '
- 'on node %(node)s.',
- {'node': node.uuid, 'step': stepname})
+ _run_playbook(node, playbook, extra_vars, key, tags=step_tags)
+ LOG.info('Ansible completed cleaning step %(step)s '
+ 'on node %(node)s.',
+ {'node': node.uuid, 'step': stepname})
@METRICS.timer('AnsibleDeploy.prepare_cleaning')
def prepare_cleaning(self, task):