From f4ae2451849f00b1ef16059dd17b8208dd9560bd Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 5 Jan 2020 21:28:12 -0500 Subject: [PATCH] Avoid splitting an empty node_limit --- client-api/api_lib/pvcapi_provisioner.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client-api/api_lib/pvcapi_provisioner.py b/client-api/api_lib/pvcapi_provisioner.py index d1e64439..6160078e 100755 --- a/client-api/api_lib/pvcapi_provisioner.py +++ b/client-api/api_lib/pvcapi_provisioner.py @@ -1300,7 +1300,12 @@ def create_vm(self, vm_name, vm_profile, define_vm=True, start_vm=True): print("Defining and starting VM on cluster") if define_vm: - retcode, retmsg = pvc_vm.define_vm(zk_conn, vm_schema, target_node, vm_data['system_details']['node_limit'].split(','), vm_data['system_details']['node_selector'], vm_data['system_details']['node_autostart'], vm_profile) + node_limit = vm_data['system_details']['node_limit'] + if node_limit: + node_limit = node_limit.split(',') + node_selector = vm_data['system_details']['node_selector'] + node_autostart = vm_data['system_details']['node_autostart'] + retcode, retmsg = pvc_vm.define_vm(zk_conn, vm_schema, target_node, node_limit, node_selector, node_autostart, vm_profile) print(retmsg) if start_vm: