From 2aa7f87ca97387462ee3cfa6da9c2996aefa2638 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 10 Jun 2021 00:55:54 -0400 Subject: [PATCH] Fix bug in creating child path keys --- daemon-common/zkhandler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon-common/zkhandler.py b/daemon-common/zkhandler.py index 7b364ac5..5cd79f70 100644 --- a/daemon-common/zkhandler.py +++ b/daemon-common/zkhandler.py @@ -731,7 +731,7 @@ class ZKSchema(object): kpath = f'{elem}.{ikey}' # Validate that the key exists for that child if not zkhandler.zk_conn.exists(self.path(kpath, child)): - zkhandler.zk_conn.create(self.path(kpath), ''.encode(zkhandler.encoding)) + zkhandler.zk_conn.create(self.path(kpath, child), ''.encode(zkhandler.encoding)) # Continue for child keys under network (reservation, acl) if elem in ['network'] and ikey in ['reservation', 'rule.in', 'rule.out']: @@ -759,7 +759,7 @@ class ZKSchema(object): kpath = f'{elem}.{ikey}' # Validate that the key exists for that child if not zkhandler.zk_conn.exists(self.path(kpath, child)): - zkhandler.zk_conn.create(self.path(kpath), ''.encode(zkhandler.encoding)) + zkhandler.zk_conn.create(self.path(kpath, child), ''.encode(zkhandler.encoding)) for elem in ['snapshot']: # First read all the subelements of the key class (pool layer) @@ -774,7 +774,7 @@ class ZKSchema(object): kpath = f'{elem}.{ikey}' # Validate that the key exists for that child if not zkhandler.zk_conn.exists(self.path(kpath, child)): - zkhandler.zk_conn.create(self.path(kpath), ''.encode(zkhandler.encoding)) + zkhandler.zk_conn.create(self.path(kpath, child), ''.encode(zkhandler.encoding)) zkhandler.zk_conn.create(self.path('base.schema.version'), self.version)