From 84967c53d95809fd804c97897abc786c4bd63657 Mon Sep 17 00:00:00 2001 From: Drazzilb <65743746+Drazzilb08@users.noreply.github.com> Date: Mon, 26 Feb 2024 08:41:51 -0800 Subject: [PATCH 1/2] requirements update --- Pipfile | 1 + Pipfile.lock | 11 ++++++++++- requirements.txt | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index 174beac..b474d99 100644 --- a/Pipfile +++ b/Pipfile @@ -14,6 +14,7 @@ pillow = "*" prettytable = "*" croniter = "*" "ruamel.yaml" = "*" +docker = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index 904d105..4a25d52 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "16de07ac6b049d09598c84add692f214864ed3b894dfab89c0fcde43a5ce2798" + "sha256": "c3e72802675e818d6b39148389574b023345eb0c4daa6ba470f7bbb12aecc010" }, "pipfile-spec": 6, "requires": { @@ -129,6 +129,15 @@ "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.0.1" }, + "docker": { + "hashes": [ + "sha256:12ba681f2777a0ad28ffbcc846a69c31b4dfd9752b47eb425a274ee269c5e14b", + "sha256:323736fb92cd9418fc5e7133bc953e11a9da04f4483f828b527db553f1e7e5a3" + ], + "index": "pypi", + "markers": "python_version >= '3.8'", + "version": "==7.0.0" + }, "idna": { "hashes": [ "sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca", diff --git a/requirements.txt b/requirements.txt index 4dcfa59..dd6f67c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,7 @@ certifi==2024.2.2; python_version >= '3.6' charset-normalizer==3.3.2; python_full_version >= '3.7.0' croniter==2.0.1; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3' +docker==7.0.0; python_version >= '3.8' idna==3.6; python_version >= '3.5' packaging==23.2; python_version >= '3.7' pillow==10.2.0; python_version >= '3.8' From f0c813f401cd67a90dff60cbbf39a93ab137cdac Mon Sep 17 00:00:00 2001 From: Drazzilb <65743746+Drazzilb08@users.noreply.github.com> Date: Mon, 26 Feb 2024 08:42:45 -0800 Subject: [PATCH 2/2] Add: additional logging statements --- main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.py b/main.py index 814bca7..7565eab 100755 --- a/main.py +++ b/main.py @@ -103,6 +103,10 @@ def run_module(script_to_run, logger): if logger: logger.error(f"Script: {script_to_run} does not exist") else: print(f"Script: {script_to_run} does not exist") return + except Exception as e: + if logger: logger.error(f"An error occurred while running the script: {script_to_run}.", exc_info=True) + else: print(f"An error occurred while running the script: {script_to_run}.") + return elif script_to_run and any(script in script_to_run for script in list_of_bash_scripts): module = "bash_scripts" try: @@ -118,6 +122,10 @@ def run_module(script_to_run, logger): if logger: logger.error(f"Script: {script_to_run} does not exist in the list of bash scripts.") else: print(f"Script: {script_to_run} does not exist in the list of bash scripts.") return + except Exception as e: + if logger: logger.error(f"An error occurred while running the script: {script_to_run}.", exc_info=True) + else: print(f"An error occurred while running the script: {script_to_run}.") + return else: if logger: logger.error(f"Script: {script_to_run} does not exist in either bash or python scripts") else: print(f"Script: {script_to_run} does not exist in either bash or python scripts")