Added context to profile constructor
This commit is contained in:
parent
fb36ac3621
commit
366e98d7ed
|
@ -25,8 +25,9 @@ class LaunchConfigProfile(base.Profile):
|
|||
'''
|
||||
spec_schema = {}
|
||||
|
||||
def __init__(self, name, type_name=__type_name__, **kwargs):
|
||||
super(LaunchConfigProfile, self).__init__(name, type_name, kwargs)
|
||||
def __init__(self, ctx, name, type_name=__type_name__, **kwargs):
|
||||
super(LaunchConfigProfile, self).__init__(ctx, name, type_name,
|
||||
**kwargs)
|
||||
|
||||
self.ImageId = kwargs.get('ImageId')
|
||||
self.InstanceType = kwargs.get('InstanceType')
|
||||
|
|
|
@ -24,8 +24,8 @@ class ResourceProfile(base.Profile):
|
|||
'''
|
||||
spec_schema = {}
|
||||
|
||||
def __init__(self, name, type_name=__type_name__, **kwargs):
|
||||
super(ResourceProfile, self).__init__(name, type_name, kwargs)
|
||||
def __init__(self, ctx, name, type_name=__type_name__, **kwargs):
|
||||
super(ResourceProfile, self).__init__(ctx, name, type_name, **kwargs)
|
||||
|
||||
def do_create(self):
|
||||
return {}
|
||||
|
|
|
@ -74,15 +74,15 @@ class StackProfile(base.Profile):
|
|||
)
|
||||
}
|
||||
|
||||
def __init__(self, type_name, name, **kwargs):
|
||||
super(StackProfile, self).__init__(type_name, name, **kwargs)
|
||||
def __init__(self, ctx, type_name, name, **kwargs):
|
||||
super(StackProfile, self).__init__(ctx, type_name, name, **kwargs)
|
||||
|
||||
# a stack profile may have its own context customization
|
||||
stack_context = self.spec_data[self.CONTEXT]
|
||||
if stack_context is not None:
|
||||
ctx = self.context.to_dict()
|
||||
ctx.update(stack_context)
|
||||
self.context = context.RequestContext.from_dict(ctx)
|
||||
ctx_dict = ctx.to_dict()
|
||||
ctx_dict.update(stack_context)
|
||||
self.context = context.RequestContext.from_dict(ctx_dict)
|
||||
|
||||
self.hc = None
|
||||
self.stack_id = None
|
||||
|
|
Loading…
Reference in New Issue