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