From 3be69d98b1bdbbaef13d4d70ecbb50e1f01b50b7 Mon Sep 17 00:00:00 2001 From: john feng Date: Tue, 19 Nov 2024 13:54:57 -0800 Subject: [PATCH] modify the sudo failed log and add line to eol --- src/core/src/bootstrap/Bootstrapper.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/src/bootstrap/Bootstrapper.py b/src/core/src/bootstrap/Bootstrapper.py index 749ee978..7a20756e 100644 --- a/src/core/src/bootstrap/Bootstrapper.py +++ b/src/core/src/bootstrap/Bootstrapper.py @@ -153,15 +153,15 @@ def check_sudo_status_with_retry(self, raise_if_not_sudo=True): try: sudo_status = self.check_sudo_status(raise_if_not_sudo=raise_if_not_sudo) if sudo_status and attempts > 1: - self.composite_logger.log_debug("Sudo Check Successfully [Attempts={0}][MaxAttempts={1}]".format(str(attempts), Constants.MAX_CHECK_SUDO_RETRY_COUNT)) + self.composite_logger.log_debug("Sudo Check Successfully [RetryCount={0}][MaxRetryCount={1}]".format(str(attempts), Constants.MAX_CHECK_SUDO_RETRY_COUNT)) return sudo_status except Exception as exception: if attempts >= Constants.MAX_CHECK_SUDO_RETRY_COUNT: - self.composite_logger.log_error("Sudo Check Failed, reached [MaxAttempts={0}][Exception={1}]".format(str(attempts), str(exception))) + self.composite_logger.log_error("Customer environment error (sudo failure). [Exception={0}][RetryCount={1}]".format(str(exception), str(attempts))) if raise_if_not_sudo: raise - self.composite_logger.log_debug("Retrying sudo status check after a delay of [ElapsedTimeInSeconds={0}][Attempts={1}]".format(Constants.MAX_CHECK_SUDO_INTERVAL_IN_SEC, str(attempts))) + self.composite_logger.log_debug("Retrying sudo status check after a delay of [ElapsedTimeInSeconds={0}][RetryCount={1}]".format(Constants.MAX_CHECK_SUDO_INTERVAL_IN_SEC, str(attempts))) time.sleep(Constants.MAX_CHECK_SUDO_INTERVAL_IN_SEC) def check_sudo_status(self, raise_if_not_sudo=True): @@ -193,3 +193,4 @@ def check_sudo_status(self, raise_if_not_sudo=True): "Exception details: " + str(exception)) if raise_if_not_sudo: raise +