def worker_run_simple(counter): """Execute the cmd to be called with """ cmd_sanity = ["%s" % x for x in parse_worker_args()] ## ready to join set_scoop_env('counter', counter) ec, out = run_simple(' '.join(cmd_sanity), disable_log=True) return ec, out ## return 1 item
def worker_run_simple(counter): """Execute the cmd to be called with """ cmd_sanity = ["%s" % x for x in parse_worker_args()] ## ready to join set_scoop_env('counter', counter) ec, out = run_simple(' '.join(cmd_sanity), disable_log=True) return ec, out ## return 1 item if __name__ == '__main__': _log = make_worker_log(NAME, debug=_DEBUG) worker_func = worker_run_simple res = None start, stop, step = parse_worker_args(False) try: _log.debug("main_run: going to start map") res_generator = futures.map(worker_func, xrange(start, stop, step)) _log.debug("main_run: finished map") res = [x for x in res_generator] _log.debug("main_run: finished res from generator") except: _log.exception("main_run: main failed with main_func %s with start %s stop %s" % (worker_func, start, stop)) print res
def worker_run_simple(counter): """Execute the cmd to be called with """ cmd_sanity = ["%s" % x for x in parse_worker_args()] ## ready to join set_scoop_env('counter', counter) ec, out = run_simple(' '.join(cmd_sanity), disable_log=True) return ec, out ## return 1 item if __name__ == '__main__': _log = make_worker_log(NAME, debug=_DEBUG) worker_func = worker_run_simple res = None start, stop, step = parse_worker_args(False) try: _log.debug("main_run: going to start map") res_generator = futures.map(worker_func, xrange(start, stop, step)) _log.debug("main_run: finished map") res = [x for x in res_generator] _log.debug("main_run: finished res from generator") except: _log.exception( "main_run: main failed with main_func %s with start %s stop %s" % (worker_func, start, stop)) print res