summaryrefslogtreecommitdiff
path: root/nova/api/metadata/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'nova/api/metadata/base.py')
-rw-r--r--nova/api/metadata/base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/api/metadata/base.py b/nova/api/metadata/base.py
index fae5b44615..11f205991f 100644
--- a/nova/api/metadata/base.py
+++ b/nova/api/metadata/base.py
@@ -686,8 +686,8 @@ def get_metadata_by_instance_id(instance_id, address, ctxt=None):
expected_attrs=attrs)
return InstanceMetadata(instance, address)
- with context.target_cell(ctxt, im.cell_mapping):
- instance = objects.Instance.get_by_uuid(ctxt, instance_id,
+ with context.target_cell(ctxt, im.cell_mapping) as cctxt:
+ instance = objects.Instance.get_by_uuid(cctxt, instance_id,
expected_attrs=attrs)
return InstanceMetadata(instance, address)