Refactor vfc catalog parser file 57/9857/1
authorying.yunlong <ying.yunlong@zte.com.cn>
Fri, 1 Sep 2017 05:08:48 +0000 (13:08 +0800)
committerying.yunlong <ying.yunlong@zte.com.cn>
Fri, 1 Sep 2017 05:08:48 +0000 (13:08 +0800)
Change-Id: Ie9d5d3a5357e5845161332f93c300ed131fd6f2e
Issue-ID: VFC-220
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
catalog/pub/utils/toscaparser/convert.py [deleted file]
catalog/pub/utils/toscaparser/dataentityext.py
catalog/pub/utils/toscaparser/nsdmodel.py
catalog/pub/utils/toscaparser/parser.py [deleted file]

diff --git a/catalog/pub/utils/toscaparser/convert.py b/catalog/pub/utils/toscaparser/convert.py
deleted file mode 100644 (file)
index 46de453..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright 2017 ZTE Corporation.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-def convert_nsd(nsd_object):
-    pass
-
-def convert_vnfd(vnfd_object):
-    pass
\ No newline at end of file
index f78faa3..7db31c7 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
 from toscaparser.dataentity import DataEntity
 from toscaparser.elements.constraints import Schema
 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:
@@ -33,4 +31,3 @@ class DataEntityExt(object):
     
             return DataEntity.validate_datatype(type, value, entry_schema, custom_def)
         return value
-
index fe5d006..bc6d921 100644 (file)
@@ -16,7 +16,6 @@ import functools
 
 from catalog.pub.utils.toscaparser.basemodel import BaseInfoModel
 
-
 class EtsiNsdInfoModel(BaseInfoModel):
 
     def __init__(self, path, params):
diff --git a/catalog/pub/utils/toscaparser/parser.py b/catalog/pub/utils/toscaparser/parser.py
deleted file mode 100644 (file)
index 7ce31b9..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright 2017 ZTE Corporation.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-from os import R_OK, access
-
-from catalog.pub.exceptions import NSLCMException
-from toscaparser.tosca_template import ToscaTemplate
-
-def parse_nsd_model(path, input_parameters):
-    isexist = check_file_exist(path)
-    if isexist:
-        nsd_tpl = parse_nsd_csar(path, input_parameters)
-    else:
-        raise NSLCMException('%s is not exist.' % path)
-    return nsd_tpl
-
-
-def parse_vnfd_model(path, input_parameters):
-    isexist = check_file_exist(path)
-    if isexist:
-        vnfd_tpl = parse_vnfd_csar(path, input_parameters)
-    else:
-        raise NSLCMException('%s is not exist.' % path)
-    return vnfd_tpl
-
-def check_file_exist(path):
-    if path.exists(path) and path.isfile(path) and access(path, R_OK):
-        return True
-    else:
-        return False
-
-def parse_nsd_csar(path, input_parameters=[], a_file=True):
-    nsd_object = None
-    nsd_object = ToscaTemplate(path, input_parameters)
-    return nsd_object
-
-
-def parse_vnfd_csar(path, input_parameters=[], a_file=True):
-    vnfd_object = None
-    vnfd_object = ToscaTemplate(path, input_parameters)
-    return vnfd_object
\ No newline at end of file