Exemplo n.º 1
0
def terminate_hosts(request, name, stage):
    get_params = request.GET
    post_params = request.POST
    host_ids = None
    if 'host_id' in get_params:
        host_ids = [get_params.get('host_id')]

    if 'hostIds' in post_params:
        hosts_str = post_params['hostIds']
        host_ids = [x.strip() for x in hosts_str.split(',')]
    environ_hosts_helper.stop_service_on_host(request, name, stage, host_ids)
    return redirect('/env/{}/{}'.format(name, stage))
Exemplo n.º 2
0
def terminate_hosts(request, name, stage):
    get_params = request.GET
    post_params = request.POST
    host_ids = None
    if "host_id" in get_params:
        host_ids = [get_params.get("host_id")]

    if "hostIds" in post_params:
        hosts_str = post_params["hostIds"]
        host_ids = [x.strip() for x in hosts_str.split(",")]
    environ_hosts_helper.stop_service_on_host(request, name, stage, host_ids)
    return redirect("/env/{}/{}".format(name, stage))