예제 #1
0
def getRandomCode() -> str:
    return randomToken(5)
예제 #2
0
p.add_argument('srid', type=int, \
        help='The server run ID that you want to restart')
p.add_argument("--adminToken", type=str,\
        help='Admin token to use(if omitted we generate a random one)')
p.add_argument(
    '--db',
    type=str,
    default=None,
    help='If specified, an explicit database for the servers to use')
args = p.parse_args()
exp = load_experiment_or_die(args.ename)

if (args.adminToken):
    adminToken = args.adminToken
else:
    adminToken = randomToken(5)

for sr in exp.server_runs:
    if sr.srid == args.srid:
        print("Found srid", args.srid)
        if sr.pid != 0:
            print("Trying to kill process", sr.pid)
            try:
                os.kill(sr.pid, signal.SIGTERM)
                print("Success in killing process", sr.pid)
            except Exception:
                print("Could not kill process " + str(sr.pid) + \
                      ", probably already dead, but please check")
            sr.pid = 0
        new_srid = exp.create_unique_server_run_id()
        port = sr.port
예제 #3
0
def getRandomCode():
    return randomToken(5)