Return none if a schema path is not found

This can cause overwriting of unintended keys, so should not be
happening. Will have to find the bugs this causes.
This commit is contained in:
Joshua Boniface 2021-07-05 17:15:55 -04:00
parent 47f39a1a2a
commit b1fcf6a4a5
1 changed files with 2 additions and 1 deletions

View File

@ -700,7 +700,8 @@ class ZKSchema(object):
base_path = '' base_path = ''
sub_path = self.schema.get(itype).get('.'.join(ipath)) sub_path = self.schema.get(itype).get('.'.join(ipath))
if sub_path is None: if sub_path is None:
sub_path = '' # We didn't find the path we're looking for, so we don't want to do anything
return None
return f'{base_path}/{item}{sub_path}' return f'{base_path}/{item}{sub_path}'
# Get keys of a schema location # Get keys of a schema location