def test_no_matching_cmd(args): commands = [ cmds.Command(hierarchy=['cmd-c'], arg_keys=['arg-0', 'arg-1', 'arg-2'], function=pytest.fail), ] with pytest.raises(Exception): cmds.execute(commands, args)
def test_no_matching_cmd(args): commands = [ cmds.Command( hierarchy=['cmd-c'], arg_keys=['arg-0', 'arg-1', 'arg-2'], function=pytest.fail), ] with pytest.raises(Exception): cmds.execute(commands, args)
def _main(argv): args = docopt.docopt(default_doc("service"), argv=argv, version="dcos-service version {}".format( dcoscli.version)) return cmds.execute(_cmds(), args)
def main(): signal.signal(signal.SIGINT, signal_handler) args = docopt.docopt(__doc__, version='dcos-marathon version {}'.format( constants.version)) return cmds.execute(_cmds(), args)
def _main(argv): args = docopt.docopt( default_doc("service"), argv=argv, version="dcos-service version {}".format(dcoscli.version)) return cmds.execute(_cmds(), args)
def _main(argv): """The main function for the 'task' subcommand""" # We must special case the 'dcos task exec' subcommand in order to # allow us to pass arguments to docopt in a more user-friendly # manner. Specifically, we need to be able to to pass arguments # beginning with "-" to the command we are trying to launch with # 'exec' without docopt trying to match them to a named parameter # for the 'dcos' command itself. if len(argv) > 1 and argv[1] == "exec": args = docopt_wrapper( default_doc("task_exec"), default_doc("task"), argv=argv[2:], version="dcos-task version {}".format(dcoscli.version), options_first=True, base_subcommand="task", subcommand="exec") else: args = docopt.docopt( default_doc("task"), argv=argv, version="dcos-task version {}".format(dcoscli.version)) return cmds.execute(_cmds(), args)
def _main(argv): args = docopt.docopt(default_doc("experimental"), argv=argv, version='dcos-experimental version {}'.format( dcoscli.version)) http.silence_requests_warnings() return cmds.execute(_cmds(), args)
def _main(argv): args = docopt.docopt( default_doc("marathon"), argv=argv, version='dcos-marathon version {}'.format(dcoscli.version)) return cmds.execute(_cmds(), args)
def _main(argv): args = docopt.docopt( default_doc("experimental"), argv=argv, version='dcos-experimental version {}'.format(dcoscli.version)) http.silence_requests_warnings() return cmds.execute(_cmds(), args)
def main(): signal.signal(signal.SIGINT, signal_handler) args = docopt.docopt( __doc__, version='dcos-marathon version {}'.format(constants.version)) return cmds.execute(_cmds(), args)
def _main(): util.configure_process_from_environ() args = docopt.docopt( _doc(), version="dcos-service version {}".format(dcoscli.version)) return cmds.execute(_cmds(), args)
def _main(): util.configure_logger_from_environ() args = docopt.docopt( __doc__, version="dcos-task version {}".format(dcoscli.version)) return cmds.execute(_cmds(), args)
def _main(): util.configure_process_from_environ() args = docopt.docopt( __doc__, version='dcos-help version {}'.format(dcoscli.version)) return cmds.execute(_cmds(), args)
def _main(): util.configure_process_from_environ() args = docopt.docopt(_doc(), version='dcos-help version {}'.format( dcoscli.version)) return cmds.execute(_cmds(), args)
def test_single_cmd(args): commands = [ cmds.Command(hierarchy=['cmd-a', 'cmd-b'], arg_keys=['arg-0', 'arg-1', 'arg-2'], function=function), ] assert cmds.execute(commands, args) == 1
def _main(): util.configure_process_from_environ() args = docopt.docopt( __doc__, version="dcos-node version {}".format(dcoscli.version)) return cmds.execute(_cmds(), args)
def _main(): util.configure_process_from_environ() args = docopt.docopt(_doc(), version='dcos-package version {}'.format( dcoscli.version)) http.silence_requests_warnings() return cmds.execute(_cmds(), args)
def test_single_cmd(args): commands = [ cmds.Command( hierarchy=['cmd-a', 'cmd-b'], arg_keys=['arg-0', 'arg-1', 'arg-2'], function=function), ] assert cmds.execute(commands, args) == 1
def _main(): util.configure_process_from_environ() args = docopt.docopt( _doc(), version='dcos-package version {}'.format(dcoscli.version)) http.silence_requests_warnings() return cmds.execute(_cmds(), args)
def test_missing_arg(args): commands = [ cmds.Command(hierarchy=['cmd-a'], arg_keys=['arg-3'], function=pytest.fail), ] with pytest.raises(KeyError): returncode, err = cmds.execute(commands, args)
def test_missing_arg(args): commands = [ cmds.Command( hierarchy=['cmd-a'], arg_keys=['arg-3'], function=pytest.fail), ] with pytest.raises(KeyError): returncode, err = cmds.execute(commands, args)
def _main(): util.configure_logger_from_environ() args = docopt.docopt( __doc__, version='myriad cli version {}'.format(constants.version)) http.silence_requests_warnings() return cmds.execute(_cmds(), args)
def _main(): util.configure_process_from_environ() args = docopt.docopt(__doc__, version='dcos-management version {}'.format( constants.version)) http.silence_requests_warnings() return cmds.execute(_cmds(), args)
def main(): signal.signal(signal.SIGINT, signal_handler) args = docopt.docopt(__doc__, version=constants.version) try: ret = cmds.execute(_cmds(), args) except DCOSException as e: emitter.publish(e) ret = 1 return ret
def _main(): util.configure_logger_from_environ() args = docopt.docopt(__doc__, version='myriad cli version {}'.format( constants.version)) http.silence_requests_warnings() return cmds.execute(_cmds(), args)
def test_similar_cmds(args): commands = [ cmds.Command(hierarchy=['cmd-a', 'cmd-b'], arg_keys=['arg-0', 'arg-1', 'arg-2'], function=function), cmds.Command(hierarchy=['cmd-a'], arg_keys=['arg-0', 'arg-1', 'arg-2'], function=pytest.fail), ] assert cmds.execute(commands, args) == 1
def main(): signal.signal(signal.SIGINT, signal_handler) args = docopt.docopt( __doc__, version=constants.version) try: ret = cmds.execute(_cmds(), args) except DCOSException as e: emitter.publish(e) ret = 1 return ret
def test_similar_cmds(args): commands = [ cmds.Command( hierarchy=['cmd-a', 'cmd-b'], arg_keys=['arg-0', 'arg-1', 'arg-2'], function=function), cmds.Command( hierarchy=['cmd-a'], arg_keys=['arg-0', 'arg-1', 'arg-2'], function=pytest.fail), ] assert cmds.execute(commands, args) == 1
def _main(argv): args = docopt.docopt(default_doc("node"), argv=argv, version="dcos-node version {}".format( dcoscli.version)) if args.get('--master'): raise DCOSException( '--master has been deprecated. Please use --leader.') elif args.get('--slave'): raise DCOSException( '--slave has been deprecated. Please use --mesos-id.') return cmds.execute(_cmds(), args)
def _main(argv): for i, arg in enumerate(argv): if arg == '--show-failures': argv[i] = '--failures' warning = ("'--show-failures' is deprecated, " "please use '--failures' instead.\n") emitter.publish(DefaultError(warning)) args = docopt.docopt(default_doc("job"), argv=argv, version='dcos-job version {}'.format(dcoscli.version)) return cmds.execute(_cmds(), args)
def _main(argv): args = docopt.docopt( default_doc("node"), argv=argv, version="dcos-node version {}".format(dcoscli.version)) if args.get('--master'): raise DCOSException( '--master has been deprecated. Please use --leader.' ) elif args.get('--slave'): raise DCOSException( '--slave has been deprecated. Please use --mesos-id.' ) return cmds.execute(_cmds(), args)
def _main(): util.configure_process_from_environ() args = docopt.docopt( _doc(), version="dcos-node version {}".format(dcoscli.version)) if args.get('--master'): raise DCOSException( '--master has been deprecated. Please use --leader.' ) elif args.get('--slave'): raise DCOSException( '--slave has been deprecated. Please use --mesos-id.' ) return cmds.execute(_cmds(), args)
def _main(argv): doc_name = 'cluster' # If a cluster is attached and the cluster linker API is reachable, # use cluster_ee.txt. dcos_url = config.get_config_val('core.dcos_url') if dcos_url: try: cluster.get_cluster_links(dcos_url) doc_name = 'cluster_ee' except Exception: pass args = docopt.docopt( default_doc(doc_name), argv=argv, version='dcos-cluster version {}'.format(dcoscli.version)) http.silence_requests_warnings() return cmds.execute(_cmds(doc_name), args)