diff options
| author | Dan Prince <dan.prince@rackspace.com> | 2011-10-12 11:17:49 -0400 |
|---|---|---|
| committer | Dan Prince <dan.prince@rackspace.com> | 2011-10-12 12:35:42 -0400 |
| commit | 7a2be6264d70faf7f97d12a3f8a252335268359f (patch) | |
| tree | 899844f5c046b3345f0695a1d25fa55bf7900331 | |
| parent | e47ddfd23efb9bd6c5b67b183df348252d4e8d04 (diff) | |
| download | nova-7a2be6264d70faf7f97d12a3f8a252335268359f.tar.gz nova-7a2be6264d70faf7f97d12a3f8a252335268359f.tar.xz nova-7a2be6264d70faf7f97d12a3f8a252335268359f.zip | |
Update EC2 get_metadata calls to search 'deleted': False. Fixes nova smoke_tests!!!
Change-Id: Ibbca93dda82013a5df51ff77b0df806fbb612af6
| -rw-r--r-- | nova/api/ec2/cloud.py | 4 | ||||
| -rw-r--r-- | nova/compute/api.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 759259519..b0130a0ad 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -285,7 +285,7 @@ class CloudController(object): def _get_mpi_data(self, context, project_id): result = {} - search_opts = {'project_id': project_id} + search_opts = {'project_id': project_id, 'deleted': False} for instance in self.compute_api.get_all(context, search_opts=search_opts): # only look at ipv4 addresses @@ -360,7 +360,7 @@ class CloudController(object): def get_metadata(self, address): ctxt = context.get_admin_context() - search_opts = {'fixed_ip': address} + search_opts = {'fixed_ip': address, 'deleted': False} try: instance_ref = self.compute_api.get_all(ctxt, search_opts=search_opts) diff --git a/nova/compute/api.py b/nova/compute/api.py index 1aafcdad0..655407b08 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -929,6 +929,9 @@ class API(base.Base): If there is no filter and the context is an admin, it will retreive all instances in the system. + + Deleted instances will be returned by default, unless there is a + search option that says otherwise. """ if search_opts is None: |
