Fix minor bugs
This commit is contained in:
parent
18fc49fc6c
commit
75d95bbef7
|
@ -290,20 +290,18 @@ def getPrimaryNode(zk_conn):
|
|||
#
|
||||
# Find a migration target
|
||||
#
|
||||
def findTargetNode(zk_conn, config, dom_uuid):
|
||||
def findTargetNode(zk_conn, dom_uuid):
|
||||
# Determine VM node limits; set config value if read fails
|
||||
try:
|
||||
node_limit = zkhandler.readdata(zk_conn, '/domains/{}/node_limit'.format(node)).split(',')
|
||||
except:
|
||||
node_limit = None
|
||||
zkhandler.writedata(zk_conn, { '/domains/{}/node_limit'.format(node): 'None' })
|
||||
|
||||
# Determine VM search field or use default; set config value if read fails
|
||||
try:
|
||||
search_field = zkhandler.readdata(zk_conn, '/domains/{}/node_selector'.format(node)).split(',')
|
||||
except:
|
||||
search_field = config.migration_target_selector
|
||||
zkhandler.writedata(zk_conn, { '/domains/{}/node_selector'.format(node): config.migration_target_selector })
|
||||
search_field = 'mem'
|
||||
|
||||
# Execute the search
|
||||
if search_field == 'mem':
|
||||
|
|
|
@ -170,7 +170,7 @@ def define_vm(zk_conn, config_data, target_node, node_limit, node_selector, node
|
|||
dom_name = parsed_xml.name.text
|
||||
|
||||
if not target_node:
|
||||
target_node = common.findTargetNode(zk_conn, selector, dom_uuid)
|
||||
target_node = common.findTargetNode(zk_conn, dom_uuid)
|
||||
else:
|
||||
# Verify node is valid
|
||||
valid_node = common.verifyNode(zk_conn, target_node)
|
||||
|
|
Loading…
Reference in New Issue