+++ /dev/null
-# Copyright 2017 ZTE Corporation.\r
-#\r
-# Licensed under the Apache License, Version 2.0 (the "License");\r
-# you may not use this file except in compliance with the License.\r
-# You may obtain a copy of the License at\r
-#\r
-# http://www.apache.org/licenses/LICENSE-2.0\r
-#\r
-# Unless required by applicable law or agreed to in writing, software\r
-# distributed under the License is distributed on an "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-# See the License for the specific language governing permissions and\r
-# limitations under the License.\r
-\r
-\r
-def convert_nsd(nsd_object):\r
- pass\r
-\r
-def convert_vnfd(vnfd_object):\r
- pass
\ No newline at end of file
from toscaparser.common.exception import ExceptionCollector
class DataEntityExt(object):
+
'''A complex data value entity ext.'''
-
@staticmethod
def validate_datatype(type, value, entry_schema=None, custom_def=None):
if value:
return DataEntity.validate_datatype(type, value, entry_schema, custom_def)
return value
-
+++ /dev/null
-# Copyright 2017 ZTE Corporation.\r
-#\r
-# Licensed under the Apache License, Version 2.0 (the "License");\r
-# you may not use this file except in compliance with the License.\r
-# You may obtain a copy of the License at\r
-#\r
-# http://www.apache.org/licenses/LICENSE-2.0\r
-#\r
-# Unless required by applicable law or agreed to in writing, software\r
-# distributed under the License is distributed on an "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-# See the License for the specific language governing permissions and\r
-# limitations under the License.\r
-from os import R_OK, access\r
-\r
-from lcm.pub.exceptions import NSLCMException\r
-from toscaparser.tosca_template import ToscaTemplate\r
-\r
-def parse_nsd_model(path, input_parameters):\r
- isexist = check_file_exist(path)\r
- if isexist:\r
- nsd_tpl = parse_nsd_csar(path, input_parameters)\r
- else:\r
- raise NSLCMException('%s is not exist.' % path)\r
- return nsd_tpl\r
-\r
-\r
-def parse_vnfd_model(path, input_parameters):\r
- isexist = check_file_exist(path)\r
- if isexist:\r
- vnfd_tpl = parse_vnfd_csar(path, input_parameters)\r
- else:\r
- raise NSLCMException('%s is not exist.' % path)\r
- return vnfd_tpl\r
-\r
-def check_file_exist(path):\r
- if path.exists(path) and path.isfile(path) and access(path, R_OK):\r
- return True\r
- else:\r
- return False\r
-\r
-def parse_nsd_csar(path, input_parameters=[], a_file=True):\r
- nsd_object = None\r
- nsd_object = ToscaTemplate(path, input_parameters)\r
- return nsd_object\r
-\r
-\r
-def parse_vnfd_csar(path, input_parameters=[], a_file=True):\r
- vnfd_object = None\r
- vnfd_object = ToscaTemplate(path, input_parameters)\r
- return vnfd_object
\ No newline at end of file