Simplify VM delete with recursive operation
This commit is contained in:
parent
831fbe8f22
commit
8f59995af4
|
@ -256,14 +256,7 @@ def undefine_vm(zk_conn, domain):
|
||||||
# Delete the configurations
|
# Delete the configurations
|
||||||
try:
|
try:
|
||||||
click.echo('Undefining VM "{}".'.format(dom_uuid))
|
click.echo('Undefining VM "{}".'.format(dom_uuid))
|
||||||
transaction = zk_conn.transaction()
|
zk_conn.delete('/domains/{}'.format(dom_uuid), recursive=True)
|
||||||
transaction.delete('/domains/{}/state'.format(dom_uuid))
|
|
||||||
transaction.delete('/domains/{}/hypervisor'.format(dom_uuid))
|
|
||||||
transaction.delete('/domains/{}/lasthypervisor'.format(dom_uuid))
|
|
||||||
transaction.delete('/domains/{}/failedreason'.format(dom_uuid))
|
|
||||||
transaction.delete('/domains/{}/xml'.format(dom_uuid))
|
|
||||||
transaction.delete('/domains/{}'.format(dom_uuid))
|
|
||||||
transaction.commit()
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue