From 41a8b26eefe732ad5cd41d0010f1274049253e9f Mon Sep 17 00:00:00 2001 From: Jared Hendrickson Date: Tue, 21 Oct 2025 19:06:49 -0600 Subject: [PATCH 1/3] fix: use local-aware time for logging This commit addresses the deprecation of the datetime.datetime.utcnow() method and replaces it with an equivalent that produces an aware datetime using the system's timezone. --- pfsense_vshell/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pfsense_vshell/__init__.py b/pfsense_vshell/__init__.py index ec6f289..6cfd6b1 100644 --- a/pfsense_vshell/__init__.py +++ b/pfsense_vshell/__init__.py @@ -307,9 +307,10 @@ def __log__(self, event, msg): :param msg: (string) a descriptive message detailing the log event :return: (none) a new item will be appended to the log property of the object """ + date = datetime.datetime.now().astimezone() self.log.append( ",".join( - [str(datetime.datetime.utcnow()), self.url(), self.username, event, msg] + [str(date), self.url(), self.username, event, msg] ) ) From 9b709f7aef5de8d02c8d6867beb6e093f014415c Mon Sep 17 00:00:00 2001 From: Jared Hendrickson Date: Tue, 21 Oct 2025 19:10:18 -0600 Subject: [PATCH 2/3] style: run black on changed files --- pfsense_vshell/__init__.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pfsense_vshell/__init__.py b/pfsense_vshell/__init__.py index 6cfd6b1..62ecaa8 100644 --- a/pfsense_vshell/__init__.py +++ b/pfsense_vshell/__init__.py @@ -308,11 +308,7 @@ def __log__(self, event, msg): :return: (none) a new item will be appended to the log property of the object """ date = datetime.datetime.now().astimezone() - self.log.append( - ",".join( - [str(date), self.url(), self.username, event, msg] - ) - ) + self.log.append(",".join([str(date), self.url(), self.username, event, msg])) class PFError(Exception): From add227951fc53453de9e067cddb6149172c9ec97 Mon Sep 17 00:00:00 2001 From: Jared Hendrickson Date: Tue, 21 Oct 2025 19:11:39 -0600 Subject: [PATCH 3/3] ci: test on pfSense CE 2.8.1-RELEASE --- .github/workflows/quality.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index cafa5a6..51bc0b3 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -38,7 +38,10 @@ jobs: needs: [check_black, check_pylint] strategy: matrix: - pfsense-version: ["pfSense-2.7.2-RELEASE", "pfSense-2.8.0-RELEASE"] + pfsense-version: + - "pfSense-2.7.2-RELEASE" + - "pfSense-2.8.0-RELEASE" + - "pfSense-2.8.1-RELEASE" steps: - uses: actions/checkout@v5