Get rid of Parameters._validate_template_parameters()

Apart from the fact that this method relied on knowledge of the template
format, it also checked nothing useful since we now won't even be able to
create the Parameters object unless all of the parameter definitions are in
fact dicts.

Change-Id: I950420b9016d350a427754d6a482b6ddf456bd6f
This commit is contained in:
Zane Bitter 2016-06-03 15:42:43 -04:00
parent bdaf407e24
commit bfa7f8554b
5 changed files with 0 additions and 20 deletions

View File

@ -306,7 +306,6 @@ def map_remote_error(ex):
'InvalidTemplateSection',
'UnknownUserParameter',
'UserParameterMissing',
'InvalidTemplateParameter',
'MissingCredentialError',
'ResourcePropertyConflict',
'PropertyUnspecifiedError',

View File

@ -80,7 +80,6 @@ class FaultWrapper(wsgi.Middleware):
'MissingCredentialError': webob.exc.HTTPBadRequest,
'UserParameterMissing': webob.exc.HTTPBadRequest,
'RequestLimitExceeded': webob.exc.HTTPBadRequest,
'InvalidTemplateParameter': webob.exc.HTTPBadRequest,
'Invalid': webob.exc.HTTPBadRequest,
'ResourcePropertyConflict': webob.exc.HTTPBadRequest,
'PropertyUnspecifiedError': webob.exc.HTTPBadRequest,

View File

@ -129,10 +129,6 @@ class InvalidTemplateSection(HeatException):
msg_fmt = _("The template section is invalid: %(section)s")
class InvalidTemplateParameter(HeatException):
msg_fmt = _("The Parameter (%(key)s) has no attributes.")
class ImmutableParameterModified(HeatException):
msg_fmt = _("The following parameters are immutable and may not be "
"updated: %(keys)s")

View File

@ -511,7 +511,6 @@ class Parameters(collections.Mapping):
This method validates if all user-provided parameters are actually
defined in the template, and if all parameters are valid.
"""
self._validate_tmpl_parameters()
self._validate_user_parameters()
for param in six.itervalues(self.params):
@ -556,18 +555,6 @@ class Parameters(collections.Mapping):
if param not in schemata:
raise exception.UnknownUserParameter(key=param)
def _validate_tmpl_parameters(self):
param = None
for key in six.iterkeys(self.tmpl.t):
if key == 'Parameters' or key == 'parameters':
param = key
break
if param is not None:
template_params = self.tmpl.t[key] or {}
for name, attrs in six.iteritems(template_params):
if not isinstance(attrs, dict):
raise exception.InvalidTemplateParameter(key=name)
def _pseudo_parameters(self, stack_identifier):
stack_id = (stack_identifier.arn()
if stack_identifier is not None else 'None')

View File

@ -187,7 +187,6 @@ class HOTemplateTest(common.HeatTestCase):
stack = parser.Stack(utils.dummy_context(), 'test_stack', tmpl)
self.assertIsNone(stack.parameters._validate_user_parameters())
self.assertIsNone(stack.parameters._validate_tmpl_parameters())
self.assertIsNone(stack.validate())
def test_translate_resources_good(self):