Refactor vfc-lcm tosca parser logic 61/9561/1
authorying.yunlong <ying.yunlong@zte.com.cn>
Thu, 31 Aug 2017 01:03:44 +0000 (09:03 +0800)
committerying.yunlong <ying.yunlong@zte.com.cn>
Thu, 31 Aug 2017 01:03:44 +0000 (09:03 +0800)
Delete the abandoned file.

Change-Id: I81008b4e0ef2afcb39326a8c1692ca078795893b
Issue-ID: VFC-196
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
lcm/pub/utils/toscaparser/basemodel.py
lcm/pub/utils/toscaparser/convert.py [deleted file]
lcm/pub/utils/toscaparser/dataentityext.py
lcm/pub/utils/toscaparser/nsdmodel.py
lcm/pub/utils/toscaparser/parser.py [deleted file]
lcm/pub/utils/toscaparser/vnfdmodel.py

index 452e6e3..7d8389d 100644 (file)
@@ -267,4 +267,5 @@ class BaseInfoModel(object):
         for node in node_templates:
             if node['name'] == name:
                 return node
-        return None
\ No newline at end of file
+        return None
+    
\ No newline at end of file
diff --git a/lcm/pub/utils/toscaparser/convert.py b/lcm/pub/utils/toscaparser/convert.py
deleted file mode 100644 (file)
index d7d7a50..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# 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
index 02c11ac..53a1a3c 100644 (file)
@@ -16,8 +16,8 @@ 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:
@@ -31,4 +31,3 @@ class DataEntityExt(object):
     
             return DataEntity.validate_datatype(type, value, entry_schema, custom_def)
         return value
-
index 9d2b5a4..8d76f22 100644 (file)
@@ -343,4 +343,4 @@ class EtsiNsdInfoModel(BaseInfoModel):
         return rets
 
     def _isFlavour(self, group):
-        return group.type.upper().find('FLAVOUR') >= 0
\ No newline at end of file
+        return group.type.upper().find('FLAVOUR') >= 0
diff --git a/lcm/pub/utils/toscaparser/parser.py b/lcm/pub/utils/toscaparser/parser.py
deleted file mode 100644 (file)
index f6605f6..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-# 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
index cdbc15b..cda9b75 100644 (file)
@@ -134,4 +134,4 @@ class EtsiVnfdInfoModel(EtsiNsdInfoModel):
 
     def _isVolumeStorage(self, node):
         return node['nodeType'].upper().find('.VOLUMESTORAGE.') >= 0 or node['nodeType'].upper().endswith(
-            '.VOLUMESTORAGE')
\ No newline at end of file
+            '.VOLUMESTORAGE')