summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/inventory/zabbix.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/inventory/zabbix.py b/contrib/inventory/zabbix.py
index 8de20ea582..43a539a006 100755
--- a/contrib/inventory/zabbix.py
+++ b/contrib/inventory/zabbix.py
@@ -173,7 +173,9 @@ class ZabbixInventory(object):
try:
api = ZabbixAPI(server=self.zabbix_server, validate_certs=self.validate_certs)
api.login(user=self.zabbix_username, password=self.zabbix_password)
- except BaseException as e:
+ # zabbix_api tries to exit if it cannot parse what the zabbix server returned
+ # so we have to use SystemExit here
+ except (Exception, SystemExit) as e:
print("Error: Could not login to Zabbix server. Check your zabbix.ini.", file=sys.stderr)
sys.exit(1)