コード例 #1
0
def agentTip(agentStats):
    agent = agentStats.agent
    hostname = agent['hostName']
    if agentStats.isStale:
        return '{}: Agent information is staled, click for more information'.format(
            hostname)

    if agent['state'] == "PAUSED_BY_USER":
        return '{}: Agent is paused explicitly for any deploy'.format(hostname)

    if agent['state'] == "PAUSED_BY_SYSTEM":
        return '{}: Agent is failed to deploy, click to see more details'.format(
            hostname)

    if agent['state'] == "DELETE":
        return '{}: Agent is removed from current environment'.format(hostname)

    if agent['state'] == "UNREACHABLE":
        return '{}: Agent is not reachable from teletraan server'.format(
            hostname)

    if agent['state'] == "STOP":
        return '{}: Agent is gracefully shutting down the service'.format(
            hostname)

    if agentStats.isCurrent:
        if agent['deployStage'] == "SERVING_BUILD":
            return '{}: Agent is serving the current build successfully'.format(
                hostname)
        else:
            if is_agent_failed(agent):
                return '{}: Agent is deploying current build with failures, click to see more detail'.format(
                    hostname)
            else:
                return '{}: Agent is deploying current build'.format(hostname)
    else:
        if agent['deployStage'] == "SERVING_BUILD":
            return '{}: Agent is serving older build and waiting for deploy'.format(
                hostname)
        else:
            if is_agent_failed(agent):
                return '{}: Agent is on older build with failures, click to see more detail'.format(
                    hostname)
            else:
                return '{}: Agent is on older build and waiting for deploy'.format(
                    hostname)
コード例 #2
0
ファイル: utils.py プロジェクト: brennentsmith/teletraan
def agentTip(agentStats):
    agent = agentStats.agent
    hostname = agent['hostName']
    if agentStats.isStale:
        return '{}: Agent information is staled, click for more information'.format(hostname)

    if agent['state'] == "PAUSED_BY_USER":
        return '{}: Agent is paused explicitly for any deploy'.format(hostname)

    if agent['state'] == "PAUSED_BY_SYSTEM":
        return '{}: Agent is failed to deploy, click to see more details'.format(hostname)

    if agent['state'] == "DELETE":
        return '{}: Agent is removed from current environment'.format(hostname)

    if agent['state'] == "UNREACHABLE":
        return '{}: Agent is not reachable from teletraan server'.format(hostname)

    if agent['state'] == "STOP":
        return '{}: Agent is gracefully shutting down the service'.format(hostname)

    if agentStats.isCurrent:
        if agent['deployStage'] == "SERVING_BUILD":
            return '{}: Agent is serving the current build successfully'.format(hostname)
        else:
            if is_agent_failed(agent):
                return '{}: Agent is deploying current build with failures, click to see more detail'.format(
                    hostname)
            else:
                return '{}: Agent is deploying current build'.format(hostname)
    else:
        if agent['deployStage'] == "SERVING_BUILD":
            return '{}: Agent is serving older build and waiting for deploy'.format(hostname)
        else:
            if is_agent_failed(agent):
                return '{}: Agent is on older build with failures, click to see more detail'.format(
                    hostname)
            else:
                return '{}: Agent is on older build and waiting for deploy'.format(hostname)
コード例 #3
0
def agentButton(agentStats):
    agent = agentStats.agent

    if agent['state'] == "PAUSED_BY_USER" or agent['state'] == "DELETE" \
            or agent['state'] == "RESET":
        return 'btn-info'

    if is_agent_failed(agent) or agent['state'] == 'UNREACHABLE':
        return 'btn-danger'

    if agent['state'] == 'STOP':
        return 'btn-warning'

    # normal state
    if agent['deployStage'] == "SERVING_BUILD" and agentStats.isCurrent:
        return 'btn-default'

    if agentStats.isCurrent:
        return 'btn-primary'

    return 'btn-warning'
コード例 #4
0
ファイル: utils.py プロジェクト: brennentsmith/teletraan
def agentButton(agentStats):
    agent = agentStats.agent

    if agent['state'] == "PAUSED_BY_USER" or agent['state'] == "DELETE" \
            or agent['state'] == "RESET":
        return 'btn-info'

    if is_agent_failed(agent) or agent['state'] == 'UNREACHABLE':
        return 'btn-danger'

    if agent['state'] == 'STOP':
        return 'btn-warning'

    # normal state
    if agent['deployStage'] == "SERVING_BUILD" and agentStats.isCurrent:
        return 'btn-default'

    if agentStats.isCurrent:
        return 'btn-primary'

    return 'btn-warning'