Skip to content

Commit

Permalink
dispatcher: Temporarily pass through to supervisor
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
zmc committed Jul 25, 2024
1 parent 8d2b939 commit 0e66771
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions scripts/dispatcher.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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__":
Expand Down

0 comments on commit 0e66771

Please sign in to comment.