Fix cloudpipe instances query.
Filter out deleted instances in _get_all_cloudpipes. Fix bug 1092786. Change-Id: Ia714a1989f78728f8b3597d6f837b622427ac5b1
This commit is contained in:
@@ -74,7 +74,9 @@ class CloudpipeController(object):
|
||||
|
||||
def _get_all_cloudpipes(self, context):
|
||||
"""Get all cloudpipes"""
|
||||
return [instance for instance in self.compute_api.get_all(context)
|
||||
instances = self.compute_api.get_all(context,
|
||||
search_opts={'deleted': False})
|
||||
return [instance for instance in instances
|
||||
if instance['image_ref'] == str(CONF.vpn_image_id)
|
||||
and instance['vm_state'] != vm_states.DELETED]
|
||||
|
||||
|
||||
@@ -39,11 +39,11 @@ def fake_vpn_instance():
|
||||
}
|
||||
|
||||
|
||||
def compute_api_get_all_empty(context):
|
||||
def compute_api_get_all_empty(context, search_opts=None):
|
||||
return []
|
||||
|
||||
|
||||
def compute_api_get_all(context):
|
||||
def compute_api_get_all(context, search_opts=None):
|
||||
return [fake_vpn_instance()]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user