From be19af02f7bf343031bf311c05cb3d4551001396 Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Fri, 21 Oct 2016 23:20:45 +0100 Subject: [PATCH] azure_rm_deployment: fix rg issue with _nic_to_public_ips_instance() (#2950) Fix an issue with _nic_to_public_ips_instance() function. There was an assumption in the code that the Public IP sits in the same resource group, this isn't always the case. --- lib/ansible/modules/extras/cloud/azure/azure_rm_deployment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/cloud/azure/azure_rm_deployment.py b/lib/ansible/modules/extras/cloud/azure/azure_rm_deployment.py index b908aa48936..b55fb5bb91d 100644 --- a/lib/ansible/modules/extras/cloud/azure/azure_rm_deployment.py +++ b/lib/ansible/modules/extras/cloud/azure/azure_rm_deployment.py @@ -644,7 +644,7 @@ class AzureRMDeploymentManager(AzureRMModuleBase): return ip_dict def _nic_to_public_ips_instance(self, nics): - return [self.network_client.public_ip_addresses.get(self.resource_group_name, public_ip_id.split('/')[-1]) + return [self.network_client.public_ip_addresses.get(public_ip_id.split('/')[4], public_ip_id.split('/')[-1]) for nic_obj in [self.network_client.network_interfaces.get(self.resource_group_name, nic['dep'].resource_name) for nic in nics] for public_ip_id in [ip_conf_instance.public_ip_address.id