Beispiel #1
0
def nomad_setup():
    n = Nomad(host=common.IP,
              port=common.NOMAD_PORT,
              ssl_verify=False,
              token=common.NOMAD_TOKEN)
    with open(common.EXAMPLE_JOB_JSON) as fh:
        n.jobs.create(json.loads(fh.read()))
    yield n
    n.jobs.stop(common.EXAMPLE_JOB_NAME, purge=True)
Beispiel #2
0
def nomad_setup():
    n = Nomad(host=common.IP, port=common.NOMAD_PORT, ssl_verify=False, token=common.NOMAD_TOKEN)
    if common.NOMAD_TOKEN is None:
        bootstrap_results = n.acl_tokens.bootstrap()
        common.NOMAD_TOKEN = bootstrap_results['SecretID']
    yield n