Correct bug in non-editor modify

This commit is contained in:
Joshua Boniface 2019-04-10 16:18:18 -04:00
parent ba4a44f5e7
commit 9809b798cc
1 changed files with 5 additions and 5 deletions

View File

@ -298,12 +298,12 @@ def vm_modify(domain, config, editor, restart):
zk_conn = pvc_common.startZKConnection(zk_host) zk_conn = pvc_common.startZKConnection(zk_host)
if editor == True: dom_uuid = pvc_vm.getDomainUUID(zk_conn, domain)
dom_uuid = pvc_vm.getDomainUUID(zk_conn, domain) if dom_uuid == None:
if dom_uuid == None: cleanup(False, 'ERROR: Could not find VM "{}" in the cluster!'.format(domain))
cleanup(False, 'ERROR: Could not find VM "{}" in the cluster!'.format(domain)) dom_name = pvc_vm.getDomainName(zk_conn, dom_uuid)
dom_name = pvc_vm.getDomainName(zk_conn, dom_uuid)
if editor == True:
# Grab the current config # Grab the current config
current_vm_config = zk_conn.get('/domains/{}/xml'.format(dom_uuid))[0].decode('ascii') current_vm_config = zk_conn.get('/domains/{}/xml'.format(dom_uuid))[0].decode('ascii')