2 # Licensed under the Apache License, Version 2.0 (the "License"); you may
3 # not use this file except in compliance with the License. You may obtain
4 # a copy of the License at
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 # License for the specific language governing permissions and limitations
14 from collections import OrderedDict
16 from toscaparser.utils.gettextutils import _
18 KEYS = (TYPE, DESCRIPTION, DEFAULT, CONSTRAINTS, HIDDEN, LABEL) = \
19 ('type', 'description', 'default', 'constraints', 'hidden', 'label')
21 log = logging.getLogger('heat-translator')
24 class HotParameter(object):
25 '''Attributes for HOT parameter section.'''
27 def __init__(self, name, type, label=None, description=None, default=None,
28 hidden=None, constraints=None):
32 self.description = description
33 self.default = default
35 self.constraints = constraints
36 log.info(_('Initialized the input parameters.'))
38 def get_dict_output(self):
39 param_sections = OrderedDict()
40 param_sections[TYPE] = self.type
42 param_sections[LABEL] = self.label
44 param_sections[DESCRIPTION] = self.description
46 param_sections[DEFAULT] = self.default
48 param_sections[HIDDEN] = self.hidden
50 param_sections[CONSTRAINTS] = self.constraints
52 return {self.name: param_sections}