Dont' attempt to remove drive if ID is "None" (#49423)

pull/48873/head
Marcin 6 years ago committed by Zim Kalinowski
parent 7fcd55f3ec
commit 8a7d19788c

@ -1431,10 +1431,11 @@ class AzureRMVirtualMachine(AzureRMModuleBase):
data_disks = vm.storage_profile.data_disks data_disks = vm.storage_profile.data_disks
for data_disk in data_disks: for data_disk in data_disks:
if(data_disk.vhd): if data_disk is not None:
vhd_uris.append(data_disk.vhd.uri) if(data_disk.vhd):
elif(data_disk.managed_disk): vhd_uris.append(data_disk.vhd.uri)
managed_disk_ids.append(data_disk.managed_disk.id) elif(data_disk.managed_disk):
managed_disk_ids.append(data_disk.managed_disk.id)
# FUTURE enable diff mode, move these there... # FUTURE enable diff mode, move these there...
self.log("VHD URIs to delete: {0}".format(', '.join(vhd_uris))) self.log("VHD URIs to delete: {0}".format(', '.join(vhd_uris)))

Loading…
Cancel
Save