From 1013a3b35b0d36fd3b5fc031d79fb34ec1a0d2ad Mon Sep 17 00:00:00 2001 From: QI ZHANG Date: Thu, 12 Mar 2015 16:31:31 +0800 Subject: [PATCH] refactor for the profile context --- senlin/profiles/base.py | 3 +-- senlin/profiles/os/heat/stack.py | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/senlin/profiles/base.py b/senlin/profiles/base.py index df99b860d..00a19f586 100644 --- a/senlin/profiles/base.py +++ b/senlin/profiles/base.py @@ -64,8 +64,7 @@ class Profile(object): kwargs = { 'id': record.id, 'spec': record.spec, - 'profile_context': context.RequestContext.from_dict( - record.context or {}), + 'profile_context': record.context, 'permission': record.permission, 'tags': record.tags, 'created_time': record.created_time, diff --git a/senlin/profiles/os/heat/stack.py b/senlin/profiles/os/heat/stack.py index cbe2a26fc..7be5245a6 100644 --- a/senlin/profiles/os/heat/stack.py +++ b/senlin/profiles/os/heat/stack.py @@ -92,6 +92,11 @@ class StackProfile(base.Profile): ctx.update(stack_context) self.context = context.RequestContext.from_dict(ctx) + if self.profile_context: + ctx = self.context.to_dict() + ctx.update(self.profile_context) + self.context = context.RequestContext.from_dict(ctx) + self.hc = heatclient.HeatClient(self.context) return self.hc