'Compare ring md5sum\'s with those on remote host
:param hosts: set of hosts to check. in the format of:
set([(\'127.0.0.1\', 6020), (\'127.0.0.2\', 6030)])
:param swift_dir: The local directory with the ring files.'

def get_ringmd5(self, hosts, swift_dir):

    matches = 0
    errors = 0
    ring_names = set()
    if (self.server_type == 'object'):
        for ring_name in os.listdir(swift_dir):
            if (ring_name.startswith('object') and ring_name.endswith('.ring.gz')):
                ring_names.add(ring_name)
    else:
        ring_name = ('%s.ring.gz' % self.server_type)
        ring_names.add(ring_name)
    rings = {}
    for ring_name in ring_names:
        rings[ring_name] = md5_hash_for_file(os.path.join(swift_dir, ring_name))
    recon = Scout('ringmd5', self.verbose, self.suppress_errors, self.timeout)
    print(('[%s]    Checking    ring    md5sums' % self._ptime()))
    if self.verbose:
        for (ring_file, ring_sum) in rings.items():
            print(('->    On    disk    %s    md5sum:    %s' % (ring_file, ring_sum)))
    for (url, response, status, ts_start, ts_end) in self.pool.imap(recon.scout, hosts):
        if (status != 200):
            errors = (errors + 1)
            continue
        success = True
        for (remote_ring_file, remote_ring_sum) in response.items():
            remote_ring_name = os.path.basename(remote_ring_file)
            if (not remote_ring_name.startswith(self.server_type)):
                continue
            ring_sum = rings.get(remote_ring_name, None)
            if (remote_ring_sum != ring_sum):
                success = False
                print(("!!    %s    (%s    =>    %s)    doesn't    match    on    disk    md5sum" % (url, remote_ring_name, remote_ring_sum)))
        if (not success):
            errors += 1
            continue
        matches += 1
        if self.verbose:
            print(('->    %s    matches.' % url))
    print(('%s/%s    hosts    matched,    %s    error[s]    while    checking    hosts.' % (matches, len(hosts), errors)))
    print(('=' * 79))
