From 87900401babc123d1e1c7c2ca27d7d68fe8d1da5 Mon Sep 17 00:00:00 2001 From: Hua Liu <58683130+liuh-80@users.noreply.github.com> Date: Fri, 7 Mar 2025 13:51:26 +0800 Subject: [PATCH] Update py_gnmicli.py --- gnmi_cli_py/py_gnmicli.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gnmi_cli_py/py_gnmicli.py b/gnmi_cli_py/py_gnmicli.py index 0ea6f3d5..efd46db3 100644 --- a/gnmi_cli_py/py_gnmicli.py +++ b/gnmi_cli_py/py_gnmicli.py @@ -253,7 +253,7 @@ def _parse_path(p_names): word_search = _RE_PATH_COMPONENT.search(word) if not word_search: # Invalid path specified. raise XpathError('xpath component parse error: %s' % word) - if word_search.group('key') is not None: # A path key was provided. + if word_search.group('key') != None: # A path key was provided. tmp_key = {} for x in re.findall(r'\[([^]]*)\]', word): tmp_key[x.split("=")[0]] = x.split("=")[-1] @@ -504,10 +504,10 @@ def subscribe_start(stub, options, req_iterator): print('gNMI Error '+str(response.error.code)+\ ' received\n'+str(response.error.message) + str(response.error)) elif response.HasField('update'): - if filter_event_regex is not None: - if filter_event_regex is not "": + if filter_event_regex != None: + if filter_event_regex != "": match = check_event_response(response, filter_event_regex) - if len(match) is not 0: + if len(match) != 0: print(response) update_count = update_count + 1 else: