Beispiel #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()))
Beispiel #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
Beispiel #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)
Beispiel #4
0
def test(service):
    chdir(get_path("test_%s.py" % service, "tests"))
    exe("py.test")
Beispiel #5
0
def run(service):
    chdir(get_path("%s.py" % service, "services"))
    exe("nameko run %s --config %s" % (
        service, get_loc())
        )
Beispiel #6
0
def test(service):
    return exe("py.test", get_path("test_%s.py" % service, "tests")).returncode
Beispiel #7
0
def run(service):
    exe(_SERVICE_EX % (service, get_loc()),
        get_path("%s.py" % service, "services"))
def main(args):
    exe("make trans")
Beispiel #9
0
def main(args):
    exe("oc %s %s %s" % (args.directory, args.outfile, args.infile))