From 28b0a522453f1e55f943032036434b0626a54446 Mon Sep 17 00:00:00 2001 From: Andre Price Date: Mon, 14 Mar 2016 12:45:06 -0700 Subject: [PATCH] Get failed deployments when create fails also --- lib/ansible/modules/extras/cloud/azure/azure_deployment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/cloud/azure/azure_deployment.py b/lib/ansible/modules/extras/cloud/azure/azure_deployment.py index 24e2c3fbe0..79875581d0 100644 --- a/lib/ansible/modules/extras/cloud/azure/azure_deployment.py +++ b/lib/ansible/modules/extras/cloud/azure/azure_deployment.py @@ -476,7 +476,8 @@ def deploy_template(module, client, conn_info): failed_deployment_operations = get_failed_deployment_operations(module, client, group_name, deployment_name) module.fail_json(msg='Deployment failed. Deployment id: %s' % (deployment_result.id), failed_deployment_operations=failed_deployment_operations) except CloudError as e: - module.fail_json(msg='Deploy create failed with status code: %s and message: "%s"' % (e.status_code, e.message)) + failed_deployment_operations = get_failed_deployment_operations(module, client, group_name, deployment_name) + module.fail_json(msg='Deploy create failed with status code: %s and message: "%s"' % (e.status_code, e.message),failed_deployment_operations=failed_deployment_operations) def destroy_resource_group(module, client, conn_info): """ @@ -613,4 +614,3 @@ from ansible.module_utils.basic import * if __name__ == '__main__': main() -