<s> from paasta_tools . cli . utils import execute_paasta_serviceinit_on_remote_master <EOL> from paasta_tools . cli . utils import figure_out_service_name <EOL> from paasta_tools . cli . utils import lazy_choices_completer <EOL> from paasta_tools . cli . utils import list_instances <EOL> from paasta_tools . cli . utils import list_services <EOL> from paasta_tools . utils import compose_job_id <EOL> from paasta_tools . utils import DEFAULT_SOA_DIR <EOL> from paasta_tools . utils import list_clusters <EOL> def add_subparser ( subparsers ) : <EOL> status_parser = subparsers . add_parser ( <EOL> '<STR_LIT>' , <EOL> help = "<STR_LIT>" , <EOL> description = ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> ) , <EOL> ) <EOL> status_parser . add_argument ( <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> help = "<STR_LIT>" , <EOL> ) . completer = lazy_choices_completer ( list_services ) <EOL> status_parser . add_argument ( <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> help = "<STR_LIT>" , <EOL> required = True , <EOL> ) . completer = lazy_choices_completer ( list_instances ) <EOL> status_parser . add_argument ( <EOL> '<STR_LIT:-c>' , '<STR_LIT>' , <EOL> help = "<STR_LIT>" , <EOL> required = True , <EOL> ) . completer = lazy_choices_completer ( list_clusters ) <EOL> status_parser . add_argument ( <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> dest = "<STR_LIT>" , <EOL> metavar = "<STR_LIT>" , <EOL> default = DEFAULT_SOA_DIR , <EOL> help = "<STR_LIT>" , <EOL> ) <EOL> status_parser . set_defaults ( command = paasta_emergency_start ) <EOL> def paasta_emergency_start ( args ) : <EOL> """<STR_LIT>""" <EOL> service = figure_out_service_name ( args , soa_dir = args . soa_dir ) <EOL> print "<STR_LIT>" % compose_job_id ( service , args . instance ) <EOL> execute_paasta_serviceinit_on_remote_master ( '<STR_LIT:start>' , args . cluster , service , args . instance ) <EOL> print "<STR_LIT:%s>" % "<STR_LIT:\n>" . join ( paasta_emergency_start . __doc__ . splitlines ( ) [ - <NUM_LIT:8> : ] ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" % ( service , args . cluster ) </s>
