From 7a2be6264d70faf7f97d12a3f8a252335268359f Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Wed, 12 Oct 2011 11:17:49 -0400 Subject: Update EC2 get_metadata calls to search 'deleted': False. Fixes nova smoke_tests!!! Change-Id: Ibbca93dda82013a5df51ff77b0df806fbb612af6 --- nova/api/ec2/cloud.py | 4 ++-- 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: -- cgit