From 771c40952b2675857182c1bbd01e0e93fb09f770 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 14 Mar 2016 10:52:45 -0700 Subject: [PATCH] Py2.6 compatible + minor fixes --- .../modules/extras/cloud/azure/azure_deployment.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/extras/cloud/azure/azure_deployment.py b/lib/ansible/modules/extras/cloud/azure/azure_deployment.py index 8550669fa09..776d5c2286f 100644 --- a/lib/ansible/modules/extras/cloud/azure/azure_deployment.py +++ b/lib/ansible/modules/extras/cloud/azure/azure_deployment.py @@ -17,7 +17,7 @@ DOCUMENTATION = ''' --- module: azure_deployment short_description: Create or destroy Azure Resource Manager template deployments -version_added: "2.0" +version_added: "2.1" description: - Create or destroy Azure Resource Manager template deployments via the Azure SDK for Python. You can find some quick start templates in GitHub here https://github.com/azure/azure-quickstart-templates. @@ -496,7 +496,7 @@ def deploy_template(module, client, conn_info): result = client.deployments.create_or_update(group_name, deployment_name, deploy_parameter) deployment_result = result.result() # Blocking wait, return the Deployment object if module.params.get('wait_for_deployment_completion'): - while not deployment_result.properties.provisioning_state in {'Canceled', 'Failed', 'Deleted', 'Succeeded'}: + while not deployment_result.properties.provisioning_state in ['Canceled', 'Failed', 'Deleted', 'Succeeded']: deployment_result = client.deployments.get(group_name, deployment_name) time.sleep(module.params.get('wait_for_deployment_polling_period')) @@ -585,9 +585,10 @@ def get_instances(client, group, deployment): return [dict(vm_name=vm.resource_name, ips=[get_ip_dict(ip) for ip in ips]) for vm, ips in vms_and_ips if len(ips) > 0] +# import module snippets +from ansible.module_utils.basic import AnsibleModule + def main(): - # import module snippets - from ansible.module_utils.basic import AnsibleModule argument_spec = dict( azure_url=dict(default=AZURE_URL), subscription_id=dict(),