Add support for list data type
In ETSI tosca definition, node type “tosca.nodes.nfv.VNF” has property “vnfm_info” that is defined as of type list. Definition given in etsi_nfv_sol001_vnfd_types.yaml: tosca.nodes.nfv.VNF: properties: vnfm_info: type: list required: true Example: tosca.nodes.nfv.VNF: properties: vnfm_info: [vnfm1, vnfm2] Added translation support for list data type. Change-Id: I02a4ba46da588ef7c1ac36a15d7cd537187e3ecc
This commit is contained in:
parent
ece660b232
commit
7be4cd79e8
@ -349,3 +349,34 @@ class ToscaTemplateInputValidationTest(TestCase):
|
||||
('default', '18.0.1')])}]
|
||||
self._translate_input_test(tpl_snippet, input_params, expectedmessage,
|
||||
expected_hot_params)
|
||||
|
||||
def test_valid_input_vnfm_info(self):
|
||||
tpl_snippet = '''
|
||||
inputs:
|
||||
vnfm_info:
|
||||
type: list
|
||||
entry_schema:
|
||||
type: string
|
||||
constraints: [ valid_values: [ Tacker ] ]
|
||||
default: [ Tacker ]
|
||||
'''
|
||||
|
||||
input_params = {'vnfm_info': ['Tacker']}
|
||||
expected_msg = _("vnfm_info type should be list")
|
||||
self._translate_input_test(tpl_snippet, input_params, expected_msg)
|
||||
|
||||
def test_invalid_input_vnfm_info(self):
|
||||
tpl_snippet = '''
|
||||
inputs:
|
||||
vnfm_info:
|
||||
type: list
|
||||
entry_schema:
|
||||
type: string
|
||||
constraints: [ valid_values: [ Tacker ] ]
|
||||
default: [ Tacker ]
|
||||
'''
|
||||
parameter = 'Tacker'
|
||||
input_params = {'vnfm_info': parameter}
|
||||
expected_msg = _('"%s" is not a list.')
|
||||
self._translate_input_test(tpl_snippet, input_params,
|
||||
expected_msg % parameter)
|
||||
|
@ -53,7 +53,8 @@ TOSCA_TO_HOT_INPUT_TYPES = {'string': 'string',
|
||||
'scalar-unit.size': 'number',
|
||||
'version': 'string',
|
||||
'null': 'string',
|
||||
'PortDef': 'number'}
|
||||
'PortDef': 'number',
|
||||
'list': 'list'}
|
||||
|
||||
log = logging.getLogger('heat-translator')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user