From d7d6e30178614dc1928e741dc51e27c67d3fe373 Mon Sep 17 00:00:00 2001 From: Tony Fernandez Date: Fri, 8 Nov 2024 13:40:23 -0500 Subject: [PATCH] moved checks from hook to schema --- borgmatic/config/schema.yaml | 1 + borgmatic/hooks/pushover.py | 7 ------- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/borgmatic/config/schema.yaml b/borgmatic/config/schema.yaml index 222a141d..e83305bb 100644 --- a/borgmatic/config/schema.yaml +++ b/borgmatic/config/schema.yaml @@ -1611,6 +1611,7 @@ properties: - finish pushover: type: object + required: ['token', 'user'] additionalProperties: false properties: token: diff --git a/borgmatic/hooks/pushover.py b/borgmatic/hooks/pushover.py index ecd6ce28..a72d4cf5 100644 --- a/borgmatic/hooks/pushover.py +++ b/borgmatic/hooks/pushover.py @@ -39,13 +39,6 @@ def ping_monitor(hook_config, config, config_filename, state, monitoring_log_lev logger.info(f'{config_filename}: Updating Pushover {dry_run_label}') - if token is None: - logger.warning(f'{config_filename}: Token missing for Pushover') - return - if user is None: - logger.warning(f'{config_filename}: User missing for Pushover') - return - if 'priority' in state_config and state_config['priority'] == 2: if 'expire' not in state_config: logger.info(f'{config_filename}: Setting expire to default (10min).')