]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
dispatcher: Temporarily pass through to supervisor 1960/head
authorZack Cerza <zack@redhat.com>
Tue, 25 Jun 2024 21:42:42 +0000 (15:42 -0600)
committerZack Cerza <zack@redhat.com>
Thu, 25 Jul 2024 00:26:57 +0000 (18:26 -0600)
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 <zack@redhat.com>
scripts/dispatcher.py

index 3497eba5b81e40392cae6733d58430903fc0636e..45dd61b264851ad8c7cd8569433ddd20f445efbe 100644 (file)
@@ -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__":