示例#1
0
def reload_tyr_safe(server, safe=True):
    """ Reload tyr on a specific server,
        in a safe way if load balancers are available
    """
    safe = get_bool_from_cli(safe)
    with settings(host_string=server):
        if env.use_load_balancer and safe:
            load_balancer.disable_node(server)
        restart_apache()
        if env.use_load_balancer and safe:
            load_balancer.enable_node(server)
示例#2
0
def reload_tyr_safe(server, safe=True):
    """ Reload tyr on a specific server,
        in a safe way if load balancers are available
    """
    safe = get_bool_from_cli(safe)
    with settings(host_string=server):
        if env.use_load_balancer and safe:
            load_balancer.disable_node(server)
        sudo("service apache2 reload")
        if env.use_load_balancer and safe:
            load_balancer.enable_node(server)
示例#3
0
def reload_jormun_safe(server, safe=True):
    """ Reload jormungandr on a specific server,
        in a safe way if load balancers are available
    """
    safe = get_bool_from_cli(safe)
    with settings(host_string=server):
        if env.use_load_balancer and safe:
            load_balancer.disable_node(server)
        sudo("service apache2 reload")
        sleep(1)
        if env.use_load_balancer and safe:
            load_balancer.enable_node(server)
示例#4
0
def reload_jormun_safe(server, safe=True):
    """ Reload jormungandr on a specific server,
        in a safe way if load balancers are available
    """

    safe = get_bool_from_cli(safe)

    with settings(host_string=server):
        if env.use_load_balancer and safe:
            load_balancer.disable_node(server)

        # Restart uWSGI if set.
        if env.uwsgi_enable:
            restart_uwsgi('jormungandr')

        else:
            restart_apache()

        if env.use_load_balancer and safe:
            load_balancer.enable_node(server)