Skip to content

Commit

Permalink
Merge pull request #69 from cdot65/67-implement-post-upgrade-snapshot…
Browse files Browse the repository at this point in the history
…s-and-configuration-backups-with-diff-support

67 implement post upgrade snapshots and configuration backups with diff support
  • Loading branch information
cdot65 authored Feb 4, 2024
2 parents fbcb5f8 + 998cf0a commit f92618c
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 21 deletions.
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ WORKDIR /app
ADD settings.yaml /app

# Install any needed packages specified in requirements.txt
# Note: The requirements.txt should contain pan-os-upgrade==1.1.0
RUN pip install --no-cache-dir pan-os-upgrade==1.1.0
# Note: The requirements.txt should contain pan-os-upgrade==1.1.1
RUN pip install --no-cache-dir pan-os-upgrade==1.1.1

# Set the locale to avoid issues with emoji rendering
ENV LANG C.UTF-8
Expand Down
9 changes: 9 additions & 0 deletions docs/about/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@

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 1.1.1

**Release Date:** *<20240204>*

### What's New

- Fixed a bug that prevented access to the `logo.png` file used by the PDF generation process

## Version 1.1.0

**Release Date:** *<20240204>*

<!-- trunk-ignore(markdownlint/MD024) -->
### What's New

- Pre/Post upgrade diff report created in PDF format
Expand Down
13 changes: 8 additions & 5 deletions pan_os_upgrade/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@


# standard library imports
import importlib.resources as pkg_resources
import ipaddress
import json
import logging
Expand Down Expand Up @@ -2969,11 +2970,13 @@ def generate_diff_report_pdf(
content = []
styles = getSampleStyleSheet()

# Custom Banner with Logo and Styling
logo = "assets/logo.png"
img = Image(logo, width=71, height=51)
img.hAlign = "LEFT"
content.append(img)
# Accessing logo.png using importlib.resources, creating a custom banner with logo and styling
with pkg_resources.files("pan_os_upgrade.assets").joinpath("logo.png") as logo_path:
img = Image(
str(logo_path), width=71, height=51
) # Convert Traversable object to string for Image path
img.hAlign = "LEFT"
content.append(img)

banner_style = styles["Title"]
banner_style.fontSize = 24
Expand Down
Loading

0 comments on commit f92618c

Please sign in to comment.