From 5a59748e6ccfc5ff9c474265cfb65263f6b65b43 Mon Sep 17 00:00:00 2001 From: Yuwei Zhou Date: Mon, 10 Dec 2018 10:30:23 +0800 Subject: [PATCH] Fix if the route table changed to none (#49533) --- lib/ansible/modules/cloud/azure/azure_rm_subnet.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/azure/azure_rm_subnet.py b/lib/ansible/modules/cloud/azure/azure_rm_subnet.py index 573c034e1db..bbc7e1ce6c6 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_subnet.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_subnet.py @@ -241,6 +241,7 @@ class AzureRMSubnet(AzureRMModuleBase): if self.security_group: nsg = self.parse_nsg() + route_table = dict() if self.route_table: route_table = self.parse_resource_to_dict(self.route_table) self.route_table = format_resource_id(val=route_table['name'], @@ -276,7 +277,7 @@ class AzureRMSubnet(AzureRMModuleBase): if self.route_table != results['route_table'].get('id'): changed = True results['route_table']['id'] = self.route_table - self.log("CHANGED: subnet {0} route_table to {1}".format(self.name, route_table['name'])) + self.log("CHANGED: subnet {0} route_table to {1}".format(self.name, route_table.get('name'))) if self.service_endpoints: oldd = {}