def create_node(version, env=None, setting=None, crate_root=None, keep_data=False): init_logging(log) settings = { 'cluster.name': 'cr8-crate-run' + str(random.randrange(1e9)) } crate_dir = get_crate(version, crate_root) if setting: settings.update(_parse_options(setting)) if env: env = _parse_options(env) return CrateNode( crate_dir=crate_dir, env=env, settings=settings, keep_data=keep_data)
def create_node(version, env=None, setting=None, crate_root=None, keep_data=False): init_logging(log) settings = {'cluster.name': 'cr8-crate-run' + str(random.randrange(1e9))} crate_dir = get_crate(version, crate_root) if setting: settings.update(_parse_options(setting)) if env: env = _parse_options(env) return CrateNode(crate_dir=crate_dir, env=env, settings=settings, keep_data=keep_data)
def main(): p = argh.ArghParser(prog='cr8', formatter_class=argparse.RawTextHelpFormatter) p.add_argument('--version', action='version', version="%(prog)s " + __version__) p.add_commands([ timeit, insert_json, insert_fake_data, insert_blob, run_spec, run_crate, run_track ]) args_groups = list(break_iterable(sys.argv[1:], lambda x: x == '--')) if len(args_groups) == 1: p.dispatch() return init_logging(log) if args_groups[0][0] == 'run-crate': _run_crate_and_rest(p, args_groups) else: for args in args_groups: p.dispatch(args)
def main(): p = argh.ArghParser( prog='cr8', formatter_class=argparse.RawTextHelpFormatter) p.add_argument( '--version', action='version', version="%(prog)s " + __version__) p.add_commands([timeit, insert_json, insert_fake_data, insert_blob, run_spec, run_crate, run_track]) args_groups = list(break_iterable(sys.argv[1:], lambda x: x == '--')) if len(args_groups) == 1: p.dispatch() return init_logging(log) if args_groups[0][0] == 'run-crate': _run_crate_and_rest(p, args_groups) else: for args in args_groups: p.dispatch(args)