From fbae5e6f5f1344fdd9f2975027f9ab79cd303f02 Mon Sep 17 00:00:00 2001 From: Calvin Remsburg Date: Mon, 22 Jan 2024 11:51:55 -0600 Subject: [PATCH 1/5] Refactor logging configuration --- pan_os_upgrade/upgrade.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pan_os_upgrade/upgrade.py b/pan_os_upgrade/upgrade.py index 1bc5e30..cbb4f1e 100644 --- a/pan_os_upgrade/upgrade.py +++ b/pan_os_upgrade/upgrade.py @@ -267,10 +267,14 @@ def configure_logging(level: str) -> None: """ logging_level = getattr(logging, level.upper(), None) - # Create a logger + # Get the root logger logger = logging.getLogger() logger.setLevel(logging_level) + # Remove any existing handlers + for handler in logger.handlers[:]: + logger.removeHandler(handler) + # Create handlers (console and file handler) console_handler = logging.StreamHandler() file_handler = RotatingFileHandler( @@ -288,12 +292,11 @@ def configure_logging(level: str) -> None: "%(asctime)s - %(name)s - %(levelname)s - %(message)s", ) else: - console_format = logging.Formatter( - "%(levelname)s - %(message)s", - ) + console_format = logging.Formatter("%(message)s") file_format = logging.Formatter( "%(asctime)s - %(name)s - %(levelname)s - %(message)s", ) + console_handler.setFormatter(console_format) file_handler.setFormatter(file_format) From b5f1bc51c50b912fae1503ce913ea25840a35466 Mon Sep 17 00:00:00 2001 From: Calvin Remsburg Date: Mon, 22 Jan 2024 11:57:10 -0600 Subject: [PATCH 2/5] Bump version to 0.2.4 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8ee6227..e0762e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pan-os-upgrade" -version = "0.2.3" +version = "0.2.4" description = "Python script to automate the upgrade process of PAN-OS firewalls." authors = ["Calvin Remsburg "] license = "Apache 2.0" From 8a435adac67f3602d2b04ab1f7214217adeaf884 Mon Sep 17 00:00:00 2001 From: Calvin Remsburg Date: Mon, 22 Jan 2024 11:57:17 -0600 Subject: [PATCH 3/5] Update pan-os-upgrade version to 0.2.4 --- docker/Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index a508498..1fc05b6 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -10,12 +10,9 @@ RUN apk add --no-cache gcc musl-dev libffi-dev make # Set the working directory in the container to /app WORKDIR /app -# Copy the requirements file into the container at /app -COPY requirements.txt /app/ - # Install any needed packages specified in requirements.txt -# Note: The requirements.txt should contain pan-os-upgrade==0.2.3 -RUN pip install --no-cache-dir pan-os-upgrade==0.2.3 +# Note: The requirements.txt should contain pan-os-upgrade==0.2.4 +RUN pip install --no-cache-dir pan-os-upgrade==0.2.4 # Set the locale to avoid issues with emoji rendering ENV LANG C.UTF-8 From 6dce0eb177d7e8de4cbae39b9cadc4e7796e0a30 Mon Sep 17 00:00:00 2001 From: Calvin Remsburg Date: Mon, 22 Jan 2024 11:57:21 -0600 Subject: [PATCH 4/5] Remove pan-os-upgrade dependency from requirements.txt --- docker/requirements.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 docker/requirements.txt diff --git a/docker/requirements.txt b/docker/requirements.txt deleted file mode 100644 index 9660ba0..0000000 --- a/docker/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pan-os-upgrade==0.2.3 \ No newline at end of file From 59f45fdf89c13e502ab839f0ffd7d63a968f42b0 Mon Sep 17 00:00:00 2001 From: Calvin Remsburg Date: Mon, 22 Jan 2024 11:57:26 -0600 Subject: [PATCH 5/5] Update release notes for version 0.2.4 --- docs/about/release-notes.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/about/release-notes.md b/docs/about/release-notes.md index a863fe0..f6553fe 100644 --- a/docs/about/release-notes.md +++ b/docs/about/release-notes.md @@ -2,10 +2,21 @@ Welcome to the release notes for the `pan-os-upgrade` tool. This document provides a detailed record of changes, enhancements, and fixes in each version of the tool. -## Version 0.2.3 +## Version 0.2.4 + +**Release Date:** *<20240122>* + +### What's New + +- Resolved a bug where console logging was duplicated +- Simplified the non-debug console log output +- Removed `requirements.txt` from Docker container image + +## Version 0.2.4 **Release Date:** *<20240121>* + ### What's New - Improved error handling for network layer transport. @@ -15,6 +26,7 @@ Welcome to the release notes for the `pan-os-upgrade` tool. This document provid **Release Date:** *<20240121>* + ### What's New - Optimized for Docker execution. @@ -24,6 +36,7 @@ Welcome to the release notes for the `pan-os-upgrade` tool. This document provid **Release Date:** *<20240121>* + ### What's New - Adjusting the execution of our script to instead reference the Typer app `app()` instead of `main()`. @@ -33,6 +46,7 @@ Welcome to the release notes for the `pan-os-upgrade` tool. This document provid **Release Date:** *<20240121>* + ### What's New - Allow for simply running `pan-os-upgrade` without arguments, providing an interactive prompt for missing variables @@ -50,7 +64,8 @@ Welcome to the release notes for the `pan-os-upgrade` tool. This document provid **Release Date:** *<20240119>* -### Highlights + +### What's New - First official release of the `pan-os-upgrade` tool on PyPi. - Made available for wide usage and distribution.