diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-01-02 16:43:49 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-01-02 16:43:49 +0000 |
commit | 40a19b7c082c781fb013aab24b92a15dc5d719db (patch) | |
tree | ea44410f5239056001a4fba437aedb4d817730ec | |
parent | edf4df3f6fa64f24d3352d69bfdd0e47bbea9f31 (diff) | |
parent | 1f2144893df2fb79238ea22d84b9b5ee47f15ac0 (diff) | |
download | nova-40a19b7c082c781fb013aab24b92a15dc5d719db.tar.gz nova-40a19b7c082c781fb013aab24b92a15dc5d719db.tar.xz nova-40a19b7c082c781fb013aab24b92a15dc5d719db.zip |
Merge "Fix cloudpipe instances query."
-rw-r--r-- | nova/api/openstack/compute/contrib/cloudpipe.py | 4 | ||||
-rw-r--r-- | nova/tests/api/openstack/compute/contrib/test_cloudpipe.py | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/nova/api/openstack/compute/contrib/cloudpipe.py b/nova/api/openstack/compute/contrib/cloudpipe.py index 1b60f6c1f..bb3007735 100644 --- a/nova/api/openstack/compute/contrib/cloudpipe.py +++ b/nova/api/openstack/compute/contrib/cloudpipe.py @@ -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] diff --git a/nova/tests/api/openstack/compute/contrib/test_cloudpipe.py b/nova/tests/api/openstack/compute/contrib/test_cloudpipe.py index 5f92d521e..1ff26a60d 100644 --- a/nova/tests/api/openstack/compute/contrib/test_cloudpipe.py +++ b/nova/tests/api/openstack/compute/contrib/test_cloudpipe.py @@ -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()] |