Handle the list of node_limits even better

This commit is contained in:
2019-12-19 13:22:38 -05:00
parent 684499cce3
commit 7901ffb5e3
4 changed files with 23 additions and 16 deletions

View File

@ -241,6 +241,9 @@ def vm_define(config, target_node, node_limit, node_selector, node_autostart):
Define a new virtual machine from Libvirt XML configuration file CONFIG.
"""
if node_limit:
node_limit = node_limit.split(',')
# Open the XML file
config_data = config.read()
config.close()
@ -277,6 +280,9 @@ def vm_meta(domain, node_limit, node_selector, node_autostart):
if node_limit is None and node_selector is None and node_autostart is None:
cleanup(False, 'At least one metadata option must be specified to update.')
if node_limit:
node_limit = node_limit.split(',')
zk_conn = pvc_common.startZKConnection(zk_host)
retcode, retmsg = pvc_vm.modify_vm_metadata(zk_conn, domain, node_limit, node_selector, node_autostart)
cleanup(retcode, retmsg, zk_conn)