Properly handle empty node limit

This commit is contained in:
Joshua Boniface 2019-10-17 13:34:11 -04:00
parent 53dc343ea2
commit 10ae260b92
1 changed files with 2 additions and 0 deletions

View File

@ -143,6 +143,8 @@ def findTargetNode(zk_conn, config, dom_uuid):
# Determine VM node limits; set config value if read fails
try:
node_limit = zkhandler.readdata(zk_conn, '/domains/{}/node_limit'.format(dom_uuid)).split(',')
if not any(node_limit):
node_limit = None
except:
node_limit = None
zkhandler.writedata(zk_conn, { '/domains/{}/node_limit'.format(dom_uuid): 'None' })