From 8c9a713de83456084c269baeb3a61d76ee58a230 Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Thu, 22 Sep 2022 19:39:31 -0400 Subject: [PATCH] [chassis][supervisor] show system-health summary fails on the supervisor card (#10631) Fix the command "sudo show system-health summary" shows the following error on the supervisor card. Fixes #10630 --- src/system-health/health_checker/service_checker.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/system-health/health_checker/service_checker.py b/src/system-health/health_checker/service_checker.py index 33eeb4dfb7..674ad99442 100644 --- a/src/system-health/health_checker/service_checker.py +++ b/src/system-health/health_checker/service_checker.py @@ -127,11 +127,11 @@ class ServiceChecker(HealthChecker): self.bad_containers.add(container) logger.log_error('Invalid syntax in critical_processes file of {}'.format(container)) continue - - identifier_key = match.group(2).strip() - identifier_value = match.group(3).strip() - if identifier_key == "program" and identifier_value: - critical_process_list.append(identifier_value) + if match.group(1) is not None: + identifier_key = match.group(2).strip() + identifier_value = match.group(3).strip() + if identifier_key == "program" and identifier_value: + critical_process_list.append(identifier_value) return critical_process_list