mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
Dont' attempt to remove drive if ID is "None" (#49423)
This commit is contained in:
parent
7fcd55f3ec
commit
8a7d19788c
1 changed files with 5 additions and 4 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue