Exemplo n.º 1
0
def identify_role_service():
    # function to get what roledefs a host belongs to. e.g sp01 -> swift-proxy
    if len(env.roles) is 0:
        return [k for k, v in env.roledefs.items()
                if util.current_host() in v]
    else:
        return env.roles
Exemplo n.º 2
0
def identify_role_service():
    #function to get what roledefs a host
    #belongs to. e.g sp01 -> swift-proxy

    if len(env.roles) is 0:
        return [k for k, v in env.roledefs.items() if util.current_host() in v]
    else:
        return env.roles
Exemplo n.º 3
0
def enable_host_services(host=None):
    if not host:
        host = current_host()
    for service in host_services(host):
        run("nova-manage service enable --host %s --service %s" %
            (service["host"], service["binary"]))
Exemplo n.º 4
0
def host_services(host=None):
    if not host:
        host = current_host()
    return [service for service in list_services()
            if service["host"] == host]
Exemplo n.º 5
0
def enable_host_services(host=None):
    if not host:
        host = current_host()
    for service in host_services(host):
        run("nova-manage service enable --host %s --service %s" %
            (service["host"], service["binary"]))
Exemplo n.º 6
0
def host_services(host=None):
    if not host:
        host = current_host()
    return [service for service in list_services() if service["host"] == host]