From 98962f810888aa14c2ec28366c4733417791eda5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rajmund=20Hru=C5=A1ka?= <rajmund.hruska@cesnet.cz> Date: Wed, 23 Sep 2020 14:06:16 +0200 Subject: [PATCH] Fix: Add python3.7 to regexp for processes --- lib/mentat/module/controller.py | 12 ++++++------ lib/mentat/system.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/mentat/module/controller.py b/lib/mentat/module/controller.py index 55a79d06..0d6b6a80 100644 --- a/lib/mentat/module/controller.py +++ b/lib/mentat/module/controller.py @@ -404,7 +404,7 @@ class MentatControllerScript(mentat.script.base.MentatBaseScript): self.retc = status['resultm'][0] # pylint: disable=locally-disabled,attribute-defined-outside-init if self.retc == mentat.system.STATUS_RT_RUNNING_OK: - self.logger.info("System startup seems successfull") + self.logger.info("System startup seems successful") return self.RESULT_SUCCESS self.logger.error("System startup seems to have failed") @@ -439,7 +439,7 @@ class MentatControllerScript(mentat.script.base.MentatBaseScript): self.retc = status['resultc'][0] # pylint: disable=locally-disabled,attribute-defined-outside-init if self.retc == mentat.system.STATUS_CJ_ENABLED: - self.logger.info("System startup seems successfull") + self.logger.info("System startup seems successful") return self.RESULT_SUCCESS self.logger.error("System startup seems to have failed") @@ -474,7 +474,7 @@ class MentatControllerScript(mentat.script.base.MentatBaseScript): # In case this is a first attempt the module was already not running. if i == 1: self.logger.info("Module '%s': Module is already not running, nothing to do", mname) - # Otherwise the stop was successfull. + # Otherwise the stop was successful. else: self.logger.info("Module '%s': Module successfully stopped", mname) continue @@ -506,7 +506,7 @@ class MentatControllerScript(mentat.script.base.MentatBaseScript): self.retc = status['resultm'][0] # pylint: disable=locally-disabled,attribute-defined-outside-init if self.retc == mentat.system.STATUS_RT_NOT_RUNNING: - self.logger.info("System shutdown seems successfull") + self.logger.info("System shutdown seems successful") return self.RESULT_SUCCESS self.logger.error("System shutdown seems to have failed") @@ -541,7 +541,7 @@ class MentatControllerScript(mentat.script.base.MentatBaseScript): self.retc = status['result'][0] # pylint: disable=locally-disabled,attribute-defined-outside-init if self.retc == mentat.system.STATUS_CJ_ENABLED: - self.logger.info("System shutdown seems successfull") + self.logger.info("System shutdown seems successful") return self.RESULT_SUCCESS self.logger.error("System shutdown seems to have failed") @@ -752,7 +752,7 @@ class MentatControllerScript(mentat.script.base.MentatBaseScript): os.sync() os.execvp(executable, arguments) - # In case the os.execv() call was successfull we should never reach + # In case the os.execv() call was successful we should never reach # this point in code. If we are here, there was a critical error. self.logger.critical( "Module '%s': Worker process '%d' was unable to execute module", diff --git a/lib/mentat/system.py b/lib/mentat/system.py index d0fd42f7..75e92576 100644 --- a/lib/mentat/system.py +++ b/lib/mentat/system.py @@ -83,7 +83,7 @@ OVERALL_STATUS_MESSAGES = { } -REGEXP_MENTAT_PS = re.compile(r'\s*(\d+)\s+([^\s]+)\s+([^\s]*(?:python3?))\s+[^\s]+(mentat-[^\s]+)(?:\s+(.*))?') +REGEXP_MENTAT_PS = re.compile(r'\s*(\d+)\s+([^\s]+)\s+([^\s]*(?:python(?:3?|3.7)))\s+[^\s]+(mentat-[^\s]+)(?:\s+(.*))?') """Regular expression for selecting Mentat related processes.""" REGEXP_MENTAT_PIDF = re.compile(r'(.+?)(?:\.(\d+))?\.pid$') """Regular expression for selecting Mentat related PID files.""" -- GitLab