Skip to content

Commit

Permalink
Merge "Update EC2 get_metadata calls to search 'deleted': False. Fixe…
Browse files Browse the repository at this point in the history
…s nova smoke_tests!!!"
  • Loading branch information
Jenkins authored and openstack-gerrit committed Oct 12, 2011
2 parents c12d610 + 7a2be62 commit c0cf874
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nova/api/ec2/cloud.py
Expand Up @@ -285,7 +285,7 @@ def _get_floaters_for_instance(self, context, instance, return_all=True):

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
Expand Down Expand Up @@ -360,7 +360,7 @@ def _format_instance_mapping(self, ctxt, instance_ref):

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)
Expand Down
3 changes: 3 additions & 0 deletions nova/compute/api.py
Expand Up @@ -929,6 +929,9 @@ def get_all(self, context, search_opts=None):
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:
Expand Down

0 comments on commit c0cf874

Please sign in to comment.