Browse Source

fix for if logic

Tony Fernandez 8 months ago
parent
commit
ccbf668bea
1 changed files with 2 additions and 2 deletions
  1. 2 2
      borgmatic/hooks/zabbix.py

+ 2 - 2
borgmatic/hooks/zabbix.py

@@ -58,7 +58,7 @@ def ping_monitor(hook_config, config, config_filename, state, monitoring_log_lev
             "id": 1,
             "id": 1,
         }
         }
 
 
-    elif host and key is not None:
+    elif (host and key) is not None:
         logger.info(f'{config_filename}: Updating Host:{host} and Key:{key} on Zabbix')
         logger.info(f'{config_filename}: Updating Host:{host} and Key:{key} on Zabbix')
         data = {
         data = {
             "jsonrpc": "2.0",
             "jsonrpc": "2.0",
@@ -80,7 +80,7 @@ def ping_monitor(hook_config, config, config_filename, state, monitoring_log_lev
         logger.info(f'{config_filename}: Using API key auth for Zabbix')
         logger.info(f'{config_filename}: Using API key auth for Zabbix')
         headers['Authorization'] = 'Bearer ' + api_key
         headers['Authorization'] = 'Bearer ' + api_key
 
 
-    elif username and password is not None:
+    elif (username and password) is not None:
         logger.info(f'{config_filename}: Using user/pass auth with user {username} for Zabbix')
         logger.info(f'{config_filename}: Using user/pass auth with user {username} for Zabbix')
         if not dry_run:
         if not dry_run:
             response = requests.post(
             response = requests.post(