Quorum state

    This state checks the mon daemons are in quorum. It does not alter the
    cluster but can be used in formula as a dependency for many cluster
    operations.

    Example usage in sls file:

    .. code-block:: yaml

        quorum:
          sesceph.quorum:
            - require:
              - sesceph: mon_running

def quorum(name, **kwargs):
    '''
    Quorum state

    This state checks the mon daemons are in quorum. It does not alter the
    cluster but can be used in formula as a dependency for many cluster
    operations.

    Example usage in sls file:

    .. code-block:: yaml

        quorum:
          sesceph.quorum:
            - require:
              - sesceph: mon_running
    '''
    parameters = _ordereddict2dict(kwargs)
    if parameters is None:
        return _error(name, "Invalid parameters:%s")

    if __opts__['test']:
        return _test(name, "cluster quorum")
    try:
        cluster_quorum = __salt__['ceph.cluster_quorum'](**parameters)
    except (CommandExecutionError, CommandNotFoundError) as err:
        return _error(name, err.strerror)
    if cluster_quorum:
        return _unchanged(name, "cluster is quorum")
    return _error(name, "cluster is not quorum")