* Fix if the route table changed to none (#49533)
(cherry picked from commit 5a59748e6c
)
* add changelog
This commit is contained in:
parent
06ffe7b5d8
commit
0dda61c258
2 changed files with 6 additions and 1 deletions
3
changelogs/fragments/azure_rm_subnet_route_table.yaml
Normal file
3
changelogs/fragments/azure_rm_subnet_route_table.yaml
Normal file
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
bugfixes:
|
||||
- "Fix if the route table changed to none (https://github.com/ansible/ansible/pull/49533)"
|
|
@ -221,6 +221,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'],
|
||||
|
@ -256,7 +257,8 @@ 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')))
|
||||
|
||||
elif self.state == 'absent':
|
||||
changed = True
|
||||
except CloudError:
|
||||
|
|
Loading…
Reference in a new issue