def terminate_hosts(request, name, stage): host_name = request.GET.get('host_name') host_id = [request.GET.get('host_id')] params = request.POST replaceHost = False if "checkToReplace" in params: replaceHost = True clusters_helper.terminate_hosts(request, name, stage, host_id, replaceHost) return redirect('/env/{}/{}/host/{}'.format(name, stage, host_name))
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(',')] clusters_helper.terminate_hosts(request, name, stage, host_ids) return redirect('/env/{}/{}'.format(name, stage))