Fix bug in creating child path keys

This commit is contained in:
Joshua Boniface 2021-06-10 00:55:54 -04:00
parent 5273c4ebfa
commit 2aa7f87ca9
1 changed files with 3 additions and 3 deletions

View File

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