(compose_file)
return False
Returns a `bool` indicating whether or not a compose file has any active services.
Returns a `bool` indicating whether or not a compose file has any active services.
Returns a bool indicating whether or not a compose file has any active services .
def compose_file_active(compose_file):
    """
    Returns a `bool` indicating whether or not a compose file has any active services.
    """
    command = ['docker-compose', '-f', compose_file, 'ps']
    lines = run_command(command, capture='out', check=True).stdout.splitlines()

    for i, line in enumerate(lines, 1):
        if set(line.strip()) == {'-'}:
            return len(lines[i:]) >= 1

    return False
def compose_file_active ( compose_file ) : command = [ 'docker-compose' , '-f' , compose_file , 'ps' ] lines = run_command ( command , capture = 'out' , check = True ) . stdout . splitlines ( ) for i , line in enumerate ( lines , 1 ) : if set ( line . strip ( ) ) == { '-' } : return len ( lines [ i : ] ) >= 1 return False