def status(name, *args, **kwargs):
    '''
    Return the status for a service.
    If the name contains globbing, a dict mapping service name to True/False
    values is returned.

    .. versionchanged:: 2018.3.0
        The service name can now be a glob (e.g. ``salt*``)

    Args:
        name (str): The name of the service to check

    Returns:
        bool: True if running, False otherwise
        dict: Maps service name to True if running, False otherwise

    CLI Example:

    .. code-block:: bash

        salt '*' service.status <service name>
    '''

    results = {}
    all_services = get_all()
    contains_globbing = bool(re.search(r'\*|\?|\[.+\]', name))
    if contains_globbing:
        services = fnmatch.filter(all_services, name)
    else:
        services = [name]
    for service in services:
        results[service] = info(service)['Status'] in ['Running', 'Stop Pending']
    if contains_globbing:
        return results
    return results[name]
def status ( name , * args , ** kwargs ) : results = { } all_services = get_all ( ) contains_globbing = bool ( re . search ( r'\*|\?|\[.+\]' , name ) ) if contains_globbing : services = fnmatch . filter ( all_services , name ) else : services = [ name ] for service in services : results [ service ] = info ( service ) [ 'Status' ] in [ 'Running' , 'Stop Pending' ] if contains_globbing : return results return results [ name ]
Return the status for a service.
    If the name contains globbing, a dict mapping service name to True/False
    values is returned.

    .. versionchanged:: 2018.3.0
        The service name can now be a glob (e.g. ``salt*``)

    Args:
        name (str): The name of the service to check

    Returns:
        bool: True if running, False otherwise
        dict: Maps service name to True if running, False otherwise

    CLI Example:

    .. code-block:: bash

        salt '*' service.status <service name>