'Get a list of hosts in the rings.
:param region_filter: Only list regions matching given filter
:param zone_filter: Only list zones matching given filter
:param swift_dir: Directory of swift config, usually /etc/swift
:param ring_names: Collection of ring names, such as
[\'object\', \'object-2\']
:returns: a set of tuples containing the ip and port of hosts'

def get_hosts(self, region_filter, zone_filter, swift_dir, ring_names):

    rings = [Ring(swift_dir, ring_name=n) for n in ring_names]
    devs = [d for r in rings for d in r.devs if d]
    if (region_filter is not None):
        devs = [d for d in devs if (d['region'] == region_filter)]
    if (zone_filter is not None):
        devs = [d for d in devs if (d['zone'] == zone_filter)]
    return set(((d['ip'], d['port']) for d in devs))
