From 2da5ea6e5685ae5c349fc1d175594aecbe0a0e23 Mon Sep 17 00:00:00 2001 From: Stanislaw Pitucha Date: Wed, 27 Mar 2013 16:17:38 +0000 Subject: Ensure only pickle-able objects live in metadata Conductor api has been added to InstanceMetadata object, but it cannot be serialised. This breaks storing metadata in memcache, because the information needs to be passed through pickle. Since the field was not used outside of the constructor, it can be removed to fix the problem. Also add a test that pickles a sample InstanceMetadata to catch similar failures in the future. Fixes bug 1160900 Change-Id: I7e8cef5a131290eaa1402d48295026bcac6baff6 --- nova/api/metadata/base.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'nova/api') diff --git a/nova/api/metadata/base.py b/nova/api/metadata/base.py index 90dcb9ca5..1f5e5b5b9 100644 --- a/nova/api/metadata/base.py +++ b/nova/api/metadata/base.py @@ -99,13 +99,12 @@ class InstanceMetadata(): self.extra_md = extra_md if conductor_api: - self.conductor_api = conductor_api + capi = conductor_api else: - self.conductor_api = conductor.API() + capi = conductor.API() ctxt = context.get_admin_context() - capi = self.conductor_api self.availability_zone = ec2utils.get_availability_zone_by_host( instance['host'], capi) -- cgit