From 3315211eed5017a5fb0bf44c4338ab30bc40b2a2 Mon Sep 17 00:00:00 2001 From: clbu Date: Wed, 11 Dec 2024 17:55:40 +0100 Subject: [PATCH] add conditional exit code --- netbox_agent/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/netbox_agent/cli.py b/netbox_agent/cli.py index 414e231..79d3ba7 100644 --- a/netbox_agent/cli.py +++ b/netbox_agent/cli.py @@ -1,3 +1,4 @@ +import sys from packaging import version import netbox_agent.dmidecode as dmidecode from netbox_agent.config import config @@ -47,8 +48,8 @@ def run(config): def main(): - return 0 if run(config) else 1 + return run(config) if __name__ == '__main__': - main() + sys.exit(main())