Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requirements update and additional logging #92

Merged
merged 2 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pillow = "*"
prettytable = "*"
croniter = "*"
"ruamel.yaml" = "*"
docker = "*"

[dev-packages]

Expand Down
11 changes: 10 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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")
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down