mirror of
https://github.com/inspec/inspec
synced 2025-02-17 06:28:40 +00:00
Fix issue where tests would fail if public DNS settings are not set (#38)
Signed-off-by: Seth Thoenen <seththoenen@gmail.com>
This commit is contained in:
parent
2a03c37bb7
commit
fc43e87ee2
1 changed files with 8 additions and 3 deletions
|
@ -308,9 +308,14 @@ class AzureVm < Inspec.resource(1)
|
|||
# Interrogate Azure for the NIC details
|
||||
public_ip = helpers.network_mgmt.client.public_ipaddresses.get(public_ip_resource_group_name, public_ip_name)
|
||||
|
||||
# update the config with the information about the public IP
|
||||
config['public_ipaddress']['domain_name_label'] = public_ip.dns_settings.domain_name_label
|
||||
config['public_ipaddress']['dns_fqdn'] = public_ip.dns_settings.fqdn
|
||||
# update the config with the information about the public IP if public dns settings are available
|
||||
if !public_ip.dns_settings.nil?
|
||||
config['public_ipaddress']['domain_name_label'] = public_ip.dns_settings.domain_name_label
|
||||
config['public_ipaddress']['dns_fqdn'] = public_ip.dns_settings.fqdn
|
||||
else
|
||||
config['public_ipaddress']['domain_name_label'] = nil
|
||||
config['public_ipaddress']['dns_fqdn'] = nil
|
||||
end
|
||||
end
|
||||
|
||||
# return object
|
||||
|
|
Loading…
Add table
Reference in a new issue