Exemplo n.º 1
0
def run(service):
    try:
        chdir(get_path("%s.py" % service, "services"))
    except Exception:
        raise RuntimeError(_SERVICE_PY)
    else:
        exe(_SERVICE_EX % (service, get_loc()))
Exemplo n.º 2
0
def test(service):
    try:
        chdir(get_path("test_%s.py" % service, "tests"))
    except Exception:
        raise RuntimeError(_SERVICE_TS)
    else:
        return exe("py.test").returncode
Exemplo n.º 3
0
def halt(service):
    comm_ps = ["ps", "ax"]
    comm_nameko = ["grep", "nameko run %s" % service]
    comm_python = ["grep", "python"]

    try:
        p_all = Popen(comm_ps, stdout=PIPE)
        p_rpc = Popen(comm_nameko, stdin=p_all.stdout, stdout=PIPE)
        p_result = Popen(comm_python, stdin=p_rpc.stdout, stdout=PIPE)
        p_all.stdout.close()
        p_rpc.stdout.close()

        proc = p_result.communicate()[0]

        if proc:
            pid = int(get_first(proc))
            exe("kill %s" % pid)
    except:
        raise RuntimeError("Error: cannot kill %s." % service)
Exemplo n.º 4
0
def test(service):
    chdir(get_path("test_%s.py" % service, "tests"))
    exe("py.test")
Exemplo n.º 5
0
def run(service):
    chdir(get_path("%s.py" % service, "services"))
    exe("nameko run %s --config %s" % (
        service, get_loc())
        )
Exemplo n.º 6
0
def test(service):
    return exe("py.test", get_path("test_%s.py" % service, "tests")).returncode
Exemplo n.º 7
0
def run(service):
    exe(_SERVICE_EX % (service, get_loc()),
        get_path("%s.py" % service, "services"))
Exemplo n.º 8
0
def main(args):
    exe("make trans")
Exemplo n.º 9
0
def main(args):
    exe("oc %s %s %s" % (args.directory, args.outfile, args.infile))