コード例 #1
0
ファイル: env_views.py プロジェクト: tuxpower/teletraan
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
ファイル: env_views.py プロジェクト: tuxpower/teletraan
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
ファイル: env_views.py プロジェクト: tuxpower/teletraan
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
ファイル: env_views.py プロジェクト: theradcoder/teletraan
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
ファイル: env_views.py プロジェクト: theradcoder/teletraan
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,
        })