Handle non-RBD disks and non-RBD errors better

This commit is contained in:
Joshua Boniface 2021-07-09 15:48:57 -04:00
parent 2138f2f59f
commit 4832245d9c
1 changed files with 9 additions and 2 deletions

View File

@ -455,9 +455,16 @@ def remove_vm(zkhandler, domain):
# Remove disks
for disk in disk_list:
# vmpool/vmname_volume
try:
disk_pool, disk_name = disk.split('/')
except ValueError:
continue
retcode, message = ceph.remove_volume(zkhandler, disk_pool, disk_name)
if not retcode:
if re.match('^ERROR: No volume with name', message):
continue
else:
return False, message
# Gracefully terminate the class instances