delete subnet should be idempotent (#35037)

This commit is contained in:
Yuwei Zhou 2018-01-25 08:59:14 +08:00 committed by Jordan Borean
commit 7c201fc9bc
2 changed files with 12 additions and 1 deletions

View file

@ -254,7 +254,7 @@ class AzureRMSubnet(AzureRMModuleBase):
resource_guid=nsg.resource_guid)
self.results['state'] = self.create_or_update_subnet(subnet)
elif self.state == 'absent':
elif self.state == 'absent' and changed:
# delete subnet
self.delete_subnet()
# the delete does not actually return anything. if no exception, then we'll assume