From c508bf28c4a3c6a3e19b6d34dd9cdaa34d66cef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Wed, 25 Sep 2024 22:16:17 +0200 Subject: [PATCH] deb: fix entrypoint --- pex.sh | 2 +- robot_failover.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pex.sh b/pex.sh index a5459fc..b9ac556 100755 --- a/pex.sh +++ b/pex.sh @@ -5,4 +5,4 @@ set -euxo pipefail poetry install poetry run pip freeze > requirements.txt -poetry run pex . -o robot_failover.pex -e robot_failover:main -r requirements.txt --python python3.11 +poetry run pex . -o robot_failover.pex -e robot_failover:cli -r requirements.txt --python python3.11 diff --git a/robot_failover.py b/robot_failover.py index 2fb3e48..5235561 100755 --- a/robot_failover.py +++ b/robot_failover.py @@ -148,5 +148,8 @@ def main(arg_vrouter, arg_type, arg_name, arg_endstate): config.dummy_interface if 'dummy_interface' in config and config.dummy_interface else False) ).start() -if __name__ == "__main__": +def cli(): main(arg_vrouter=int(sys.argv[1]), arg_type=sys.argv[2], arg_name=sys.argv[3], arg_endstate=sys.argv[4]) + +if __name__ == "__main__": + cli()