Init parser and convert file 93/7693/1
authorying.yunlong <ying.yunlong@zte.com.cn>
Wed, 16 Aug 2017 07:27:49 +0000 (15:27 +0800)
committerying.yunlong <ying.yunlong@zte.com.cn>
Wed, 16 Aug 2017 07:27:49 +0000 (15:27 +0800)
In order to call parser to parse tosca
package, add the function name to init
the code logic.

Change-Id: Ide1c0940e40ca665d71f3959ddce80b4d5cc9ba8
Issue-ID: VFC-97
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
lcm/pub/utils/toscaparser/__init__.py
lcm/pub/utils/toscaparser/convert.py
lcm/pub/utils/toscaparser/parser.py

index a2564f7..d764402 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from lcm.pub.utils.toscaparser.convert import convert_nsd, convert_vnfd
+from lcm.pub.utils.toscaparser.parser import parse_nsd_model, parse_vnfd_model
+
+
 def parse_nsd(path, input_parameters=[]):
-    pass
+    nsd_object = parse_nsd_model(path, input_parameters=[])
+    nsd_json = convert_nsd(nsd_object)
+    return nsd_json
 
 def parse_vnfd(path, input_parameters=[]):
-    pass
\ No newline at end of file
+    vnfd_object = parse_vnfd_model(path, input_parameters=[])
+    vnfd_json = convert_vnfd(vnfd_object)
+    return vnfd_json
index 5399fe6..d7d7a50 100644 (file)
 # 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 5399fe6..e1692ed 100644 (file)
 # 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 parse_nsd_model(path, input_parameters):\r
+    check_file_exist(path)\r
+    nsd_tpl = parse_nsd_csar(path, input_parameters)\r
+    return nsd_tpl\r
+\r
+\r
+def parse_vnfd_model(path, input_parameters):\r
+    check_file_exist(path)\r
+    vnfd_tpl = parse_vnfd_csar(path, input_parameters)\r
+    return vnfd_tpl\r
+\r
+def check_file_exist(path):\r
+    pass\r
+\r
+def parse_nsd_csar(path, input_parameters=[], a_file=True):\r
+    pass\r
+\r
+def parse_vnfd_csar(path, input_parameters=[], a_file=True):\r
+    pass
\ No newline at end of file