Merge "Use python-tuskarclient api to retrieve plan templates"
This commit is contained in:
commit
5b072bf767
@ -24,6 +24,8 @@ from tuskar_ui.handle_errors import handle_errors # noqa
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
TUSKAR_ENDPOINT_URL = getattr(django.conf.settings, 'TUSKAR_ENDPOINT_URL')
|
||||
MASTER_TEMPLATE_NAME = 'plan.yaml'
|
||||
ENVIRONMENT_NAME = 'environment.yaml'
|
||||
|
||||
|
||||
# FIXME: request isn't used right in the tuskar client right now,
|
||||
@ -35,7 +37,7 @@ def tuskarclient(request):
|
||||
|
||||
|
||||
class OvercloudPlan(base.APIResourceWrapper):
|
||||
_attrs = ('id', 'name', 'description', 'created_at', 'modified_at',
|
||||
_attrs = ('id', 'uuid', 'name', 'description', 'created_at', 'modified_at',
|
||||
'roles', 'parameters')
|
||||
|
||||
def __init__(self, apiresource, request=None):
|
||||
@ -152,22 +154,23 @@ class OvercloudPlan(base.APIResourceWrapper):
|
||||
for role in self.roles]
|
||||
|
||||
@cached_property
|
||||
def template(self):
|
||||
#TODO(tzumainn): replace with actual call to tuskar api
|
||||
#once tuskar pythonclient is updated
|
||||
return ""
|
||||
def templates(self):
|
||||
return tuskarclient(self._request).plans.templates(self.uuid)
|
||||
|
||||
@cached_property
|
||||
def master_template(self):
|
||||
return self.templates.get(MASTER_TEMPLATE_NAME, '')
|
||||
|
||||
@cached_property
|
||||
def environment(self):
|
||||
#TODO(tzumainn): replace with actual call to tuskar api
|
||||
#once tuskar pythonclient is updated
|
||||
return ""
|
||||
return self.templates.get(ENVIRONMENT_NAME, '')
|
||||
|
||||
@cached_property
|
||||
def provider_resource_templates(self):
|
||||
#TODO(tzumainn): replace with actual call to tuskar api
|
||||
#once tuskar pythonclient is updated
|
||||
return {}
|
||||
template_dict = dict(self.templates)
|
||||
del template_dict[MASTER_TEMPLATE_NAME]
|
||||
del template_dict[ENVIRONMENT_NAME]
|
||||
return template_dict
|
||||
|
||||
def parameter_list(self, include_key_parameters=True):
|
||||
params = self.parameters
|
||||
|
@ -66,7 +66,7 @@ class DeployOvercloud(horizon.forms.SelfHandlingForm):
|
||||
if not stack:
|
||||
api.heat.Stack.create(request,
|
||||
plan.name,
|
||||
plan.template,
|
||||
plan.master_template,
|
||||
plan.environment,
|
||||
plan.provider_resource_templates)
|
||||
except Exception:
|
||||
|
Loading…
x
Reference in New Issue
Block a user