From b1fcf6a4a5c0987ef72de54d96edc8d7bb9e4eda Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 5 Jul 2021 17:15:55 -0400 Subject: [PATCH] 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. --- daemon-common/zkhandler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/daemon-common/zkhandler.py b/daemon-common/zkhandler.py index bd32adcc..78603a19 100644 --- a/daemon-common/zkhandler.py +++ b/daemon-common/zkhandler.py @@ -700,7 +700,8 @@ class ZKSchema(object): base_path = '' sub_path = self.schema.get(itype).get('.'.join(ipath)) 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}' # Get keys of a schema location