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
for data_disk in data_disks:
if(data_disk.vhd):
vhd_uris.append(data_disk.vhd.uri)
elif(data_disk.managed_disk):
managed_disk_ids.append(data_disk.managed_disk.id)
if data_disk is not None:
if(data_disk.vhd):
vhd_uris.append(data_disk.vhd.uri)
elif(data_disk.managed_disk):
managed_disk_ids.append(data_disk.managed_disk.id)
# FUTURE enable diff mode, move these there...
self.log("VHD URIs to delete: {0}".format(', '.join(vhd_uris)))

Loading…
Cancel
Save