From bb410b3f1bbdebdbdf540a22cd37fc9526897fe1 Mon Sep 17 00:00:00 2001 From: Chris Behrens Date: Wed, 28 Sep 2011 23:52:57 +0000 Subject: Change 'recurse_zones' to 'local_zone_only'. Fixes bug 861753 Zone recursion should be the default and now 'recurse_zones' as an optional search argument no longer makes sense. 'local_zone_only=True' can now be specified to override the new default of recursing zones. Change-Id: I5c3c849e9077117b2023f637b82831fa14b656b1 --- nova/compute/api.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/api.py b/nova/compute/api.py index e40183a4b..7bf28d24e 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -959,7 +959,6 @@ class API(base.Base): 'name': 'display_name', 'instance_name': 'name', 'tenant_id': 'project_id', - 'recurse_zones': None, 'flavor': _remap_flavor_filter, 'fixed_ip': _remap_fixed_ip_filter} @@ -974,19 +973,18 @@ class API(base.Base): except KeyError: filters[opt] = value else: - if remap_object: - if isinstance(remap_object, basestring): - filters[remap_object] = value - else: - remap_object(value) + # Remaps are strings to translate to, or functions to call + # to do the translating as defined by the table above. + if isinstance(remap_object, basestring): + filters[remap_object] = value + else: + remap_object(value) - recurse_zones = search_opts.get('recurse_zones', False) - if 'reservation_id' in filters: - recurse_zones = True + local_zone_only = search_opts.get('local_zone_only', False) instances = self._get_instances_by_filters(context, filters) - if not recurse_zones: + if local_zone_only: return instances # Recurse zones. Send along the un-modified search options we received. -- cgit