cdot65 / pan-os-upgrade

An efficient tool to execute configuration backups, network state snapshots, system readiness checks, and operating system upgrades of Palo Alto Networks firewalls and Panorama appliances.
https://cdot65.github.io/pan-os-upgrade/
Apache License 2.0
39 stars 9 forks source link

Bug: Missing Logs Directory Causing Script to Error Out #12

Closed cdot65 closed 9 months ago

cdot65 commented 9 months ago

Issue Summary

There's a critical bug in the current version of our script where it fails to execute properly due to a missing logs directory in the root of the project. This issue prevents the creation of any logs, causing the script to error out.

Detailed Description

Error Behavior: When attempting to run the script, it tries to access or create logs in a 'logs' directory expected to be present in the root of the project. However, since this directory does not exist, the script is unable to proceed, leading to an error.

Expected Behavior: The script should either check for the existence of the 'logs' directory and create it if it's not there or handle the absence of this directory more gracefully without causing a runtime error.

Steps to Reproduce

Clone the repository and set up the environment as per the instructions. Run the script without manually creating a 'logs' directory in the project root. Observe that the script errors out due to the absence of the expected logs directory.

Suggested Fix

There are a few potential approaches to resolve this issue:

.gitkeep: Create a .gitkeep fild within the empty ./logs directory will ensure that it is checked into the repository

Automatic Directory Creation: Modify the script to check if the 'logs' directory exists at the start. If it doesn't, the script should automatically create it.

Error Handling Improvement: Enhance the script's error handling to manage the absence of the 'logs' directory more gracefully, possibly by logging to an alternative location or generating a clear error message. Impact:

This bug currently impedes the script’s usability for any new users or setups where the 'logs' directory is not pre-created, making it a critical issue that needs immediate attention.

Request for Assistance

We are seeking contributions for a quick resolution of this bug. This can include:

Analyzing and identifying the exact cause of the error.

Implementing the suggested fix or an alternative solution.

Testing the fix to ensure the issue is resolved and the script functions as expected in environments without an existing 'logs' directory.

cdot65 commented 9 months ago

This was resolved with commit 8d412cad46e93aead092cf66a00bd9d5c05ef892