fixed deallocated vm facts problem (#52540)

This commit is contained in:
Zim Kalinowski 2019-02-19 10:20:50 +08:00 committed by ansibot
parent a499244a53
commit d6600b0ab6

View file

@ -347,10 +347,10 @@ class AzureRMVirtualMachineFacts(AzureRMModuleBase):
disks = result['properties']['storageProfile']['dataDisks']
for disk_index in range(len(disks)):
new_result['data_disks'].append({
'lun': disks[disk_index]['lun'],
'disk_size_gb': disks[disk_index]['diskSizeGB'],
'managed_disk_type': disks[disk_index]['managedDisk']['storageAccountType'],
'caching': disks[disk_index]['caching']
'lun': disks[disk_index].get('lun'),
'disk_size_gb': disks[disk_index].get('diskSizeGB'),
'managed_disk_type': disks[disk_index].get('managedDisk', {}).get('storageAccountType'),
'caching': disks[disk_index].get('caching')
})
new_result['network_interface_names'] = []