From 953e46055ae51ec52d5a279bc9c251b71b9c20ab Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 14 Jun 2021 21:06:15 -0400 Subject: [PATCH] Fix issue with loading None version schema --- node-daemon/pvcnoded/Daemon.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/node-daemon/pvcnoded/Daemon.py b/node-daemon/pvcnoded/Daemon.py index a0f2cfc4..4d339ebe 100644 --- a/node-daemon/pvcnoded/Daemon.py +++ b/node-daemon/pvcnoded/Daemon.py @@ -538,6 +538,8 @@ try: node_schema_version = int(zkhandler.read(('node.data.active_schema', myhostname))) except Exception: node_schema_version = zkhandler.read('base.schema.version') + if node_schema_version is None: + node_schema_version = 0 zkhandler.write([ (('node.data.active_schema', myhostname), node_schema_version) ]) @@ -559,7 +561,10 @@ zkhandler.write([ def update_schema(new_schema_version, stat, event=''): global zkhandler, update_timer, node_schema_version - new_schema_version = int(new_schema_version.decode('ascii')) + try: + new_schema_version = int(new_schema_version.decode('ascii')) + except Exception: + new_schema_version = 0 if new_schema_version == node_schema_version: return True