diff --git a/client-common/vm.py b/client-common/vm.py index 286ef7b8..6ae83965 100644 --- a/client-common/vm.py +++ b/client-common/vm.py @@ -220,7 +220,6 @@ def modify_vm_metadata(zk_conn, domain, node_limit, node_selector, node_autostar if not dom_uuid: return False, 'ERROR: Could not find VM "{}" in the cluster!'.format(domain) - if node_limit is not None: zkhandler.writedata(zk_conn, { '/domains/{}/node_limit'.format(dom_uuid): node_limit @@ -249,10 +248,11 @@ def modify_vm(zk_conn, domain, restart, new_vm_config): '/domains/{}'.format(dom_uuid): dom_name, '/domains/{}/xml'.format(dom_uuid): new_vm_config } - if restart == True: - zk_data.update({'/domains/{}/state'.format(dom_uuid): 'restart'}) zkhandler.writedata(zk_conn, zk_data) + if restart: + zkhandler.writedata(zk_conn, {'/domains/{}/state'.format(dom_uuid): 'restart'}) + return True, '' def dump_vm(zk_conn, domain):