From f5a1dd31c8e5807e52196ecfd337c22e0f197bf5 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Sun, 23 Jun 2024 18:28:41 -0700 Subject: [PATCH] Fix PagerDuty hook traceback with Python < 3.10 (#886). --- NEWS | 3 +++ borgmatic/hooks/pagerduty.py | 2 +- setup.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 8707723..700b568 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +1.8.13.dev0 + * #886: Fix PagerDuty hook traceback with Python < 3.10. + 1.8.12 * #817: Add a "--max-duration" flag to the "check" action and a "max_duration" option to the repository check configuration. This tells Borg to interrupt a repository check after a certain diff --git a/borgmatic/hooks/pagerduty.py b/borgmatic/hooks/pagerduty.py index 6ec1a6e..e9e34da 100644 --- a/borgmatic/hooks/pagerduty.py +++ b/borgmatic/hooks/pagerduty.py @@ -40,7 +40,7 @@ def ping_monitor(hook_config, config, config_filename, state, monitoring_log_lev return hostname = platform.node() - local_timestamp = datetime.datetime.now(datetime.UTC).astimezone().isoformat() + local_timestamp = datetime.datetime.now(datetime.timezone.utc).astimezone().isoformat() payload = json.dumps( { 'routing_key': hook_config['integration_key'], diff --git a/setup.py b/setup.py index 23c446b..da814e2 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import find_packages, setup -VERSION = '1.8.12' +VERSION = '1.8.13.dev0' setup(