From c531ecbd297ebff0f1489d7a846ebbd4e09e8581 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Tue, 25 Jun 2024 15:42:42 -0600 Subject: [PATCH] dispatcher: Temporarily pass through to supervisor The old dispatcher expects to be able to invoke the supervisor via `teuthology-dispatcher --supervisor`, so add this compatibility shim for the time being. Signed-off-by: Zack Cerza --- scripts/dispatcher.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/dispatcher.py b/scripts/dispatcher.py index 3497eba5b..45dd61b26 100644 --- a/scripts/dispatcher.py +++ b/scripts/dispatcher.py @@ -1,7 +1,9 @@ import argparse import sys -import teuthology.dispatcher +import teuthology.dispatcher.supervisor + +from .supervisor import parse_args as parse_supervisor_args def parse_args(argv): @@ -43,7 +45,17 @@ def parse_args(argv): def main(): - sys.exit(teuthology.dispatcher.main(parse_args(sys.argv[1:]))) + if "--supervisor" in sys.argv: + # This is for transitional compatibility, so the old dispatcher can + # invoke the new supervisor. Once old dispatchers are phased out, + # this block can be as well. + sys.argv.remove("--supervisor") + sys.argv[0] = "teuthology-supervisor" + sys.exit(teuthology.dispatcher.supervisor.main( + parse_supervisor_args(sys.argv[1:]) + )) + else: + sys.exit(teuthology.dispatcher.main(parse_args(sys.argv[1:]))) if __name__ == "__main__":