'Get a list of hosts for non-deleted instances in the group
This method allows you to get a list of the hosts where instances in
this group are currently running.  There\'s also an option to exclude
certain instance UUIDs from this calculation.'

@base.remotable
def get_hosts(self, exclude=None):

    filter_uuids = self.members
    if exclude:
        filter_uuids = (set(filter_uuids) - set(exclude))
    filters = {'uuid': filter_uuids, 'deleted': False}
    instances = objects.InstanceList.get_by_filters(self._context, filters=filters)
    return list(set([instance.host for instance in instances if instance.host]))
