refactor for the profile context

This commit is contained in:
QI ZHANG 2015-03-12 16:31:31 +08:00
parent ad269a2ff2
commit 1013a3b35b
2 changed files with 6 additions and 2 deletions

View File

@ -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,

View File

@ -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