diff options
| author | Jason Koelker <jason@koelker.net> | 2011-09-14 17:11:21 -0500 |
|---|---|---|
| committer | Jason Koelker <jason@koelker.net> | 2011-09-14 17:11:21 -0500 |
| commit | e8a2a540e574ca2d242b9c2749c1f285498809e7 (patch) | |
| tree | d0b0f56fb103ce3081d68b3a8e7d2fa299ca6804 /nova/compute | |
| parent | 9936e1e9457234f7285c794b7c2c286603c84e52 (diff) | |
fix up the filtering so it does not return duplicates if both the network and the db filters match
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index 22ae17e0a..122e62208 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -930,7 +930,7 @@ class API(base.Base): return instances def _get_instances_by_filters(self, context, filters): - ip_instances = None + ids = None if 'ip6' in filters or 'ip' in filters: res = self.network_api.get_instance_ids_by_ip_filter(context, filters) @@ -938,12 +938,7 @@ class API(base.Base): # instance id twice (one for ipv4 and ipv4) ids = set([r['instance_id'] for r in res]) - # NOTE(jkoelker) When this flips to using UUIDS the name - # needs to be updated accordingingly - ip_instances = [self.db.instance_get(context, id) for id in ids] - - return self.db.instance_get_all_by_filters(context, filters, - ip_instances) + return self.db.instance_get_all_by_filters(context, filters, ids) def _cast_compute_message(self, method, context, instance_id, host=None, params=None): |
