From 10ae260b9294f9d73bcab7bd343d3e1903ea0d67 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Thu, 17 Oct 2019 13:34:11 -0400 Subject: [PATCH] Properly handle empty node limit --- node-daemon/pvcd/common.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node-daemon/pvcd/common.py b/node-daemon/pvcd/common.py index ed363159..6c00eded 100644 --- a/node-daemon/pvcd/common.py +++ b/node-daemon/pvcd/common.py @@ -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' })