Fixes #39648 azure_rm_virtualnetwork not handling DNS settings properly on existing virtual networks (#40646)

* check nullable

* add test

* fix

* fix
This commit is contained in:
Yuwei Zhou 2018-05-28 15:45:01 +08:00 committed by Zim Kalinowski
commit 7b9864776a
2 changed files with 12 additions and 1 deletions

View file

@ -257,7 +257,7 @@ class AzureRMVirtualNetwork(AzureRMModuleBase):
changed = True
if self.dns_servers:
existing_dns_set = set(vnet.dhcp_options.dns_servers)
existing_dns_set = set(vnet.dhcp_options.dns_servers) if vnet.dhcp_options else set([])
requested_dns_set = set(self.dns_servers)
if existing_dns_set != requested_dns_set:
self.log('CHANGED: replacing DNS servers')