SLAVE CALL
    Verifies that the master and the slave versions are in sync by
    comparing the index version. If you are constantly pushing updates
    the index the master and slave versions will seldom match. A solution
    to this is pause indexing every so often to allow the slave to replicate
    and then call this method before allowing indexing to resume.

    host : str (None)
        The solr host to query. __opts__['host'] is default.
    core_name : str (None)
        The name of the solr core if using cores. Leave this blank if you are
        not using cores or if you want to check all cores.

    Return : dict<str,obj>::

        {'success':boolean, 'data':dict, 'errors':list, 'warnings':list}

    CLI Example:

    .. code-block:: bash

        salt '*' solr.match_index_versions music

def match_index_versions(host=None, core_name=None):
    '''
    SLAVE CALL
    Verifies that the master and the slave versions are in sync by
    comparing the index version. If you are constantly pushing updates
    the index the master and slave versions will seldom match. A solution
    to this is pause indexing every so often to allow the slave to replicate
    and then call this method before allowing indexing to resume.

    host : str (None)
        The solr host to query. __opts__['host'] is default.
    core_name : str (None)
        The name of the solr core if using cores. Leave this blank if you are
        not using cores or if you want to check all cores.

    Return : dict<str,obj>::

        {'success':boolean, 'data':dict, 'errors':list, 'warnings':list}

    CLI Example:

    .. code-block:: bash

        salt '*' solr.match_index_versions music
    '''
    # since only slaves can call this let's check the config:
    ret = _get_return_dict()
    success = True
    if _is_master() and _get_none_or_value(host) is None:
        return ret.update({
            'success': False,
            'errors': [
                'solr.match_index_versions can only be called by '
                '"slave" minions'
            ]
        })
    # get the default return dict

    def _match(ret, success, resp, core):
        if response['success']:
            slave = resp['data']['details']['slave']
            master_url = resp['data']['details']['slave']['masterUrl']
            if 'ERROR' in slave:
                error = slave['ERROR']
                success = False
                err = "{0}: {1} - {2}".format(core, error, master_url)
                resp['errors'].append(err)
                # if there was an error return the entire response so the
                # alterer can get what it wants
                data = slave if core is None else {core: {'data': slave}}
            else:
                versions = {
                    'master': slave['masterDetails']['master'][
                        'replicatableIndexVersion'],
                    'slave': resp['data']['details']['indexVersion'],
                    'next_replication': slave['nextExecutionAt'],
                    'failed_list': []
               }
                if 'replicationFailedAtList' in slave:
                    versions.update({'failed_list': slave[
                        'replicationFailedAtList']})
                # check the index versions
                if versions['master'] != versions['slave']:
                    success = False
                    resp['errors'].append(
                        'Master and Slave index versions do not match.'
                    )
                data = versions if core is None else {core: {'data': versions}}
            ret = _update_return_dict(ret, success, data,
                                        resp['errors'], resp['warnings'])
        else:
            success = False
            err = resp['errors']
            data = resp['data']
            ret = _update_return_dict(ret, success, data, errors=err)
        return (ret, success)

    # check all cores?
    if _get_none_or_value(core_name) is None and _check_for_cores():
        success = True
        for name in __opts__['solr.cores']:
            response = _replication_request('details', host=host,
                                            core_name=name)
            ret, success = _match(ret, success, response, name)
    else:
        response = _replication_request('details', host=host,
                                        core_name=core_name)
        ret, success = _match(ret, success, response, core_name)

    return ret