예제 #1
0
def get_all_hosts(request, name, stage):
    envs = environs_helper.get_all_env_stages(request, name)
    stages, env = common.get_all_stages(envs, stage)
    progress = deploys_helper.update_progress(request, name, stage)
    agents_wrapper = agent_report.gen_agent_by_deploy(progress, env['deployId'],
                                                      TOTAL_HOST_REPORT)
    title = "All hosts"

    return render(request, 'environs/env_hosts.html', {
        "env": env,
        "stages": stages,
        "agents_wrapper": agents_wrapper,
        "title": title,
    })
예제 #2
0
def get_unknown_hosts(request, name, stage):
    envs = environs_helper.get_all_env_stages(request, name)
    stages, env = common.get_all_stages(envs, stage)
    progress = deploys_helper.update_progress(request, name, stage)
    agents_wrapper = agent_report.gen_agent_by_deploy(progress,
                                                      env['deployId'],
                                                      UNKNOWN_HOST_REPORT)
    title = "Unknow hosts"

    return render(
        request, 'environs/env_hosts.html', {
            "env": env,
            "stages": stages,
            "agents_wrapper": agents_wrapper,
            "title": title,
        })
예제 #3
0
def get_failed_hosts(request, name, stage):
    envs = environs_helper.get_all_env_stages(request, name)
    stages, env = common.get_all_stages(envs, stage)
    progress = deploys_helper.update_progress(request, name, stage)
    agents_wrapper = agent_report.gen_agent_by_deploy(progress,
                                                      env['deployId'],
                                                      FAILED_HOST_REPORT)
    title = "Failed Hosts"

    return render(
        request, 'environs/env_hosts.html', {
            "env": env,
            "stages": stages,
            "agents_wrapper": agents_wrapper,
            "title": title,
            "is_retryable": True
        })
예제 #4
0
def get_failed_hosts(request, name, stage):
    envs = environs_helper.get_all_env_stages(request, name)
    stages, env = common.get_all_stages(envs, stage)
    progress = deploys_helper.update_progress(request, name, stage)
    agents_wrapper = agent_report.gen_agent_by_deploy(progress, env['deployId'],
                                                      FAILED_HOST_REPORT)
    failed_hosts = [agent['hostId'] for agent in agents_wrapper[env['deployId']]]
    host_ids = ",".join(failed_hosts)
    title = "Failed Hosts"

    return render(request, 'environs/env_hosts.html', {
        "env": env,
        "stages": stages,
        "agents_wrapper": agents_wrapper,
        "title": title,
        "is_retryable": True,
        "host_ids": host_ids,
        "pinterest": IS_PINTEREST,
    })
예제 #5
0
def get_hosts_by_deploy(request, name, stage, deploy_id):
    hostStageString = request.GET.get('hostStage')
    if hostStageString is None:
        hostStage = TOTAL_ALIVE_HOST_REPORT
    else:
        hostStage = hostStageString
    envs = environs_helper.get_all_env_stages(request, name)
    stages, env = common.get_all_stages(envs, stage)
    progress = deploys_helper.update_progress(request, name, stage)
    agents_wrapper = agent_report.gen_agent_by_deploy(progress, deploy_id,
                                                      ALIVE_STAGE_HOST_REPORT, hostStage)
    title = "All hosts with deploy " + deploy_id

    return render(request, 'environs/env_hosts.html', {
        "env": env,
        "stages": stages,
        "agents_wrapper": agents_wrapper,
        "title": title,
    })
예제 #6
0
def get_hosts_by_deploy(request, name, stage, deploy_id):
    hostStageString = request.GET.get('hostStage')
    if hostStageString is None:
        hostStage = TOTAL_ALIVE_HOST_REPORT
    else:
        hostStage = hostStageString
    envs = environs_helper.get_all_env_stages(request, name)
    stages, env = common.get_all_stages(envs, stage)
    progress = deploys_helper.update_progress(request, name, stage)
    agents_wrapper = agent_report.gen_agent_by_deploy(progress, deploy_id,
                                                      ALIVE_STAGE_HOST_REPORT,
                                                      hostStage)
    title = "All hosts with deploy " + deploy_id

    return render(
        request, 'environs/env_hosts.html', {
            "env": env,
            "stages": stages,
            "agents_wrapper": agents_wrapper,
            "title": title,
        })
예제 #7
0
def get_failed_hosts(request, name, stage):
    envs = environs_helper.get_all_env_stages(request, name)
    stages, env = common.get_all_stages(envs, stage)
    progress = deploys_helper.update_progress(request, name, stage)
    agents_wrapper = agent_report.gen_agent_by_deploy(progress,
                                                      env['deployId'],
                                                      FAILED_HOST_REPORT)
    failed_hosts = [
        agent['hostId'] for agent in agents_wrapper[env['deployId']]
    ]
    host_ids = ",".join(failed_hosts)
    title = "Failed Hosts"

    return render(
        request, 'environs/env_hosts.html', {
            "env": env,
            "stages": stages,
            "agents_wrapper": agents_wrapper,
            "title": title,
            "is_retryable": True,
            "host_ids": host_ids,
            "pinterest": IS_PINTEREST,
        })