From 51b885e7db7001de0a63cefb604d7f15058c22d6 Mon Sep 17 00:00:00 2001 From: Tony Fernandez Date: Fri, 8 Nov 2024 19:49:23 -0500 Subject: [PATCH] added global constant for priority --- borgmatic/hooks/pushover.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/borgmatic/hooks/pushover.py b/borgmatic/hooks/pushover.py index 8540e8c5..1ce7eaed 100644 --- a/borgmatic/hooks/pushover.py +++ b/borgmatic/hooks/pushover.py @@ -5,6 +5,8 @@ import requests logger = logging.getLogger(__name__) +EMERGENCY_PRIORITY = 2 + def initialize_monitor( ping_url, config, config_filename, monitoring_log_level, dry_run ): # pragma: no cover @@ -34,7 +36,7 @@ def ping_monitor(hook_config, config, config_filename, state, monitoring_log_lev logger.info(f'{config_filename}: Updating Pushover{dry_run_label}') - if state_config.get('priority') == 2: + if state_config.get('priority') == EMERGENCY_PRIORITY: if 'expire' not in state_config: logger.info(f'{config_filename}: Setting expire to default (10min).') state_config['expire'] = 600