From 89c6a11be4bc4aecccdb9a8730e7e51524fba5a1 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 2 Jun 2024 00:08:25 +0200 Subject: [PATCH] fix: fix sysexit with custom error (#703) --- ansibledoctor/doc_generator.py | 2 +- ansibledoctor/utils/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ansibledoctor/doc_generator.py b/ansibledoctor/doc_generator.py index 7429062f..0b4851fe 100644 --- a/ansibledoctor/doc_generator.py +++ b/ansibledoctor/doc_generator.py @@ -56,7 +56,7 @@ def _create_dir(self, directory): os.makedirs(directory, exist_ok=True) self.logger.info(f"Creating dir: {directory}") except FileExistsError as e: - self.log.sysexit_with_message(str(e)) + self.log.sysexit_with_message(e) def _write_doc(self): files_to_overwite = [] diff --git a/ansibledoctor/utils/__init__.py b/ansibledoctor/utils/__init__.py index 3349f0b2..b65fdaaf 100644 --- a/ansibledoctor/utils/__init__.py +++ b/ansibledoctor/utils/__init__.py @@ -287,7 +287,7 @@ def sysexit(self, code=1): sys.exit(code) def sysexit_with_message(self, msg, code=1): - self.logger.critical(str(msg.strip())) + self.logger.critical(str(msg).strip()) self.sysexit(code)