예제 #1
0
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
예제 #2
0
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
예제 #3
0
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


예제 #4
0
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