diff --git a/states/zabbix/scripts/apt.py b/states/zabbix/scripts/apt.py index 60bd634..874b39e 100644 --- a/states/zabbix/scripts/apt.py +++ b/states/zabbix/scripts/apt.py @@ -56,8 +56,13 @@ def isSecurityUpgrade(pkg, depcache): return False def main(): - pkgs = get_updates() - sys.exit(str(len(pkgs))) + ret = -1 + try: + pkgs = get_updates() + ret = len(pkgs) + except Exception as e: + print(f"{e}", file=sys.stderr) + print(ret) if __name__ == "__main__": main()