Handle non-RBD disks and non-RBD errors better
This commit is contained in:
parent
2138f2f59f
commit
4832245d9c
|
@ -455,9 +455,16 @@ def remove_vm(zkhandler, domain):
|
||||||
# Remove disks
|
# Remove disks
|
||||||
for disk in disk_list:
|
for disk in disk_list:
|
||||||
# vmpool/vmname_volume
|
# vmpool/vmname_volume
|
||||||
|
try:
|
||||||
disk_pool, disk_name = disk.split('/')
|
disk_pool, disk_name = disk.split('/')
|
||||||
|
except ValueError:
|
||||||
|
continue
|
||||||
|
|
||||||
retcode, message = ceph.remove_volume(zkhandler, disk_pool, disk_name)
|
retcode, message = ceph.remove_volume(zkhandler, disk_pool, disk_name)
|
||||||
if not retcode:
|
if not retcode:
|
||||||
|
if re.match('^ERROR: No volume with name', message):
|
||||||
|
continue
|
||||||
|
else:
|
||||||
return False, message
|
return False, message
|
||||||
|
|
||||||
# Gracefully terminate the class instances
|
# Gracefully terminate the class instances
|
||||||
|
|
Loading…
Reference in New Issue