Fix minor bugs
This commit is contained in:
parent
e5393082b6
commit
0763bd2d51
|
@ -413,12 +413,12 @@ def move_vm(zk_conn, domain, target_node):
|
||||||
# Verify node is valid
|
# Verify node is valid
|
||||||
valid_node = common.verifyNode(zk_conn, target_node)
|
valid_node = common.verifyNode(zk_conn, target_node)
|
||||||
if not valid_node:
|
if not valid_node:
|
||||||
return False, 'Specified node "{}" is invalid.'.format(target_node)
|
return False, 'ERROR: Specified node "{}" is invalid.'.format(target_node)
|
||||||
|
|
||||||
# Check if node is within the limit
|
# Check if node is within the limit
|
||||||
limit = zkhandler.readdata(zk_conn, '/domains/{}/node_limit'.format(dom_uuid).split(',')
|
node_limit = zkhandler.readdata(zk_conn, '/domains/{}/node_limit'.format(dom_uuid)).split(',')
|
||||||
if target_node not in limit:
|
if node_limit and target_node not in node_limit:
|
||||||
return False, 'Specified node "{}" is not in the allowed list of nodes for VM "{}".'.format(target_node, domain)
|
return False, 'ERROR: Specified node "{}" is not in the allowed list of nodes for VM "{}".'.format(target_node, domain)
|
||||||
|
|
||||||
# Verify if node is current node
|
# Verify if node is current node
|
||||||
if target_node == current_node:
|
if target_node == current_node:
|
||||||
|
@ -473,12 +473,12 @@ def migrate_vm(zk_conn, domain, target_node, force_migrate, is_cli=False):
|
||||||
# Verify node is valid
|
# Verify node is valid
|
||||||
valid_node = common.verifyNode(zk_conn, target_node)
|
valid_node = common.verifyNode(zk_conn, target_node)
|
||||||
if not valid_node:
|
if not valid_node:
|
||||||
return False, 'Specified node "{}" is invalid.'.format(target_node)
|
return False, 'ERROR: Specified node "{}" is invalid.'.format(target_node)
|
||||||
|
|
||||||
# Check if node is within the limit
|
# Check if node is within the limit
|
||||||
limit = zkhandler.readdata(zk_conn, '/domains/{}/node_limit'.format(dom_uuid).split(',')
|
node_limit = zkhandler.readdata(zk_conn, '/domains/{}/node_limit'.format(dom_uuid)).split(',')
|
||||||
if target_node not in limit:
|
if node_limit and target_node not in node_limit:
|
||||||
return False, 'Specified node "{}" is not in the allowed list of nodes for VM "{}".'.format(target_node, domain)
|
return False, 'ERROR: Specified node "{}" is not in the allowed list of nodes for VM "{}".'.format(target_node, domain)
|
||||||
|
|
||||||
# Verify if node is current node
|
# Verify if node is current node
|
||||||
if target_node == current_node:
|
if target_node == current_node:
|
||||||
|
|
Loading…
Reference in New Issue