Browse Source

moved checks from hook to schema

Tony Fernandez 7 months ago
parent
commit
d7d6e30178
2 changed files with 1 additions and 7 deletions
  1. 1 0
      borgmatic/config/schema.yaml
  2. 0 7
      borgmatic/hooks/pushover.py

+ 1 - 0
borgmatic/config/schema.yaml

@@ -1611,6 +1611,7 @@ properties:
                     - finish
     pushover:
         type: object
+        required: ['token', 'user']
         additionalProperties: false
         properties:
             token:

+ 0 - 7
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).')