diff --git a/python/lsst/ts/IntegrationTests/csc_state_transition.py b/python/lsst/ts/IntegrationTests/csc_state_transition.py index ed2ebc7f..9c9002ec 100644 --- a/python/lsst/ts/IntegrationTests/csc_state_transition.py +++ b/python/lsst/ts/IntegrationTests/csc_state_transition.py @@ -55,12 +55,10 @@ def __init__( self, csc: str, state: str, - csc_index: int = 0, additional_configuration: str = "", ) -> None: super().__init__() self.csc = csc - self.csc_index = csc_index self.state = state self.added_config = additional_configuration # Set the ScriptQueue index based on which telescope. @@ -70,11 +68,7 @@ def __init__( self.index = 1 # Construct the intermediate configuration list. # Convert the list to a string. - if self.csc_index: - full_csc_name = f"{self.csc}:{self.csc_index}" - else: - full_csc_name = self.csc - temp_config = [full_csc_name, self.state] + temp_config = [self.csc, self.state] if self.added_config: temp_config.append(self.added_config) config = ", ".join(str(i) for i in temp_config) @@ -105,7 +99,6 @@ def csc_state_transition() -> None: metavar="csc", nargs="?", type=str, - choices=csc_list, help="Specify which CSC to command (case sensitive).", ) parser.add_argument( @@ -116,14 +109,6 @@ def csc_state_transition() -> None: choices=state_list, help="Specify to which state to transition.", ) - parser.add_argument( - "-x", - "--csc_index", - metavar="index", - nargs="?", - type=int, - help="Define the index of the CSC, if applicable.", - ) parser.add_argument( "-a", "--additional_configuration", @@ -138,21 +123,16 @@ def csc_state_transition() -> None: help="Print the allowed options.", ) args = parser.parse_args() - # Print the help if the camera is not defined, - # or info is not passed. - if not (args.info or args.csc or args.state): + if args.info: parser.print_help() exit() - if args.info: - print( - f"\nThe allowed options are:\n" - f" csc:\t{csc_list}\n\n" - f" state:\t{state_list}\n" - ) + # Print the help if the CSC or STATE is not defined. + if not (args.csc or args.state): + parser.print_help() exit() - if args.csc not in utils.cscs: + if args.csc.split(":")[0] not in utils.cscs: print( - f"Invalid CSC: {args.csc}. " + f"Invalid CSC: {args.csc.split(":")[0]}. " f"Perhaps it is misspelled or not properly capitalized." ) parser.print_help() @@ -168,7 +148,6 @@ def main(opts: argparse.Namespace) -> None: script_class = CSCStateTransition( csc=opts.csc, state=opts.state, - csc_index=opts.csc_index, additional_configuration=opts.additional_configuration, ) except KeyError as ke: