Avoid splitting an empty node_limit

This commit is contained in:
Joshua Boniface 2020-01-05 21:28:12 -05:00
parent 6fc12b4438
commit f4ae245184
1 changed files with 6 additions and 1 deletions

View File

@ -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: