I was able to reproduce it easily with the nfv example.
So I made the following change:
diff --git a/toscaparser/extensions/nfv/TOSCA_nfv_definition_1_0_0.yaml b/toscaparser/extensions/nfv/TOSCA_nfv_definition_1_0_0.yaml
index 365d70e..869fe96 100644
--- a/toscaparser/extensions/nfv/TOSCA_nfv_definition_1_0_0.yaml
+++ b/toscaparser/extensions/nfv/TOSCA_nfv_definition_1_0_0.yaml
@@ -23,7 +23,7 @@ tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
# Node Templates.
##########################################################################
node_types:
- tosca.nodes.nfv.VNF:
+ nfv.tosca.nodes.VNF:
derived_from: tosca.nodes.Root # Or should this be its own top - level type?
properties:
id:
diff --git a/toscaparser/extensions/nfv/tests/data/tosca_helloworld_nfv.yaml b/toscaparser/extensions/nfv/tests/data/tosca_helloworld_nfv.yaml
index 6afa9f0..da885d1 100644
--- a/toscaparser/extensions/nfv/tests/data/tosca_helloworld_nfv.yaml
+++ b/toscaparser/extensions/nfv/tests/data/tosca_helloworld_nfv.yaml
@@ -8,7 +8,7 @@ metadata:
topology_template:
node_templates:
VNF1:
- type: tosca.nodes.nfv.VNF
+ type: nfv.tosca.nodes.VNF
properties:
id: vnf1
vendor: acmetelco
diff --git a/toscaparser/extensions/nfv/tests/test_tosca_nfv_tpl.py b/toscaparser/extensions/nfv/tests/test_tosca_nfv_tpl.py
index b166d83..8d896ba 100644
--- a/toscaparser/extensions/nfv/tests/test_tosca_nfv_tpl.py
+++ b/toscaparser/extensions/nfv/tests/test_tosca_nfv_tpl.py
Here the exception the above change caused when running test:
InvalidTypeError: Type "nfv.tosca.nodes.VNF" is not a valid type.
File test_tosca_nfv_tpl.py, line 18, in <module>
class ToscaNFVTemplateTest():
File test_tosca_nfv_tpl.py, line 24, in ToscaNFVTemplateTest
tosca = ToscaTemplate(tosca_tpl)
File /Users/wliang/tmp/translator/venv/lib/python3.6/site-packages/toscaparser/tosca_template.py, line 101, in __init__
self.topology_template = self._topology_template()
File /Users/wliang/tmp/translator/venv/lib/python3.6/site-packages/toscaparser/tosca_template.py, line 120, in _topology_template
None)
File /Users/wliang/tmp/translator/venv/lib/python3.6/site-packages/toscaparser/topology_template.py, line 57, in __init__
self.nodetemplates = self._nodetemplates()
File /Users/wliang/tmp/translator/venv/lib/python3.6/site-packages/toscaparser/topology_template.py, line 92, in _nodetemplates
self.rel_types)
File /Users/wliang/tmp/translator/venv/lib/python3.6/site-packages/toscaparser/nodetemplate.py, line 43, in __init__
custom_def)
File /Users/wliang/tmp/translator/venv/lib/python3.6/site-packages/toscaparser/entity_template.py, line 52, in __init__
if type is not None else None
File /Users/wliang/tmp/translator/venv/lib/python3.6/site-packages/toscaparser/elements/nodetype.py, line 30, in __init__
super(NodeType, self).__init__(ntype, self.NODE_PREFIX, custom_def)
File /Users/wliang/tmp/translator/venv/lib/python3.6/site-packages/toscaparser/elements/statefulentitytype.py, line 51, in __init__
InvalidTypeError(what=entitytype))
I was able to reproduce it easily with the nfv example.
So I made the following change:
diff --git a/toscaparser/ extensions/ nfv/TOSCA_ nfv_definition_ 1_0_0.yaml b/toscaparser/ extensions/ nfv/TOSCA_ nfv_definition_ 1_0_0.yaml extensions/ nfv/TOSCA_ nfv_definition_ 1_0_0.yaml extensions/ nfv/TOSCA_ nfv_definition_ 1_0_0.yaml ns_version: tosca_simple_ profile_ for_nfv_ 1_0_0 ####### ####### ####### ####### ####### ####### ####### ####### ####### ##### nfv.VNF: nodes.VNF: extensions/ nfv/tests/ data/tosca_ helloworld_ nfv.yaml b/toscaparser/ extensions/ nfv/tests/ data/tosca_ helloworld_ nfv.yaml extensions/ nfv/tests/ data/tosca_ helloworld_ nfv.yaml extensions/ nfv/tests/ data/tosca_ helloworld_ nfv.yaml extensions/ nfv/tests/ test_tosca_ nfv_tpl. py b/toscaparser/ extensions/ nfv/tests/ test_tosca_ nfv_tpl. py extensions/ nfv/tests/ test_tosca_ nfv_tpl. py extensions/ nfv/tests/ test_tosca_ nfv_tpl. py
index 365d70e..869fe96 100644
--- a/toscaparser/
+++ b/toscaparser/
@@ -23,7 +23,7 @@ tosca_definitio
# Node Templates.
######
node_types:
- tosca.nodes.
+ nfv.tosca.
derived_from: tosca.nodes.Root # Or should this be its own top - level type?
properties:
id:
diff --git a/toscaparser/
index 6afa9f0..da885d1 100644
--- a/toscaparser/
+++ b/toscaparser/
@@ -8,7 +8,7 @@ metadata:
topology_template:
node_templates:
VNF1:
- type: tosca.nodes.nfv.VNF
+ type: nfv.tosca.nodes.VNF
properties:
id: vnf1
vendor: acmetelco
diff --git a/toscaparser/
index b166d83..8d896ba 100644
--- a/toscaparser/
+++ b/toscaparser/
Here the exception the above change caused when running test:
InvalidTypeError: Type "nfv.tosca. nodes.VNF" is not a valid type. nfv_tpl. py, line 18, in <module> eTest() : nfv_tpl. py, line 24, in ToscaNFVTemplat eTest tosca_tpl) wliang/ tmp/translator/ venv/lib/ python3. 6/site- packages/ toscaparser/ tosca_template. py, line 101, in __init__ topology_ template = self._topology_ template( ) wliang/ tmp/translator/ venv/lib/ python3. 6/site- packages/ toscaparser/ tosca_template. py, line 120, in _topology_template wliang/ tmp/translator/ venv/lib/ python3. 6/site- packages/ toscaparser/ topology_ template. py, line 57, in __init__ nodetemplates = self._nodetempl ates() wliang/ tmp/translator/ venv/lib/ python3. 6/site- packages/ toscaparser/ topology_ template. py, line 92, in _nodetemplates wliang/ tmp/translator/ venv/lib/ python3. 6/site- packages/ toscaparser/ nodetemplate. py, line 43, in __init__ wliang/ tmp/translator/ venv/lib/ python3. 6/site- packages/ toscaparser/ entity_ template. py, line 52, in __init__ wliang/ tmp/translator/ venv/lib/ python3. 6/site- packages/ toscaparser/ elements/ nodetype. py, line 30, in __init__ _init__ (ntype, self.NODE_PREFIX, custom_def) wliang/ tmp/translator/ venv/lib/ python3. 6/site- packages/ toscaparser/ elements/ statefulentityt ype.py, line 51, in __init__ rror(what= entitytype) )
File test_tosca_
class ToscaNFVTemplat
File test_tosca_
tosca = ToscaTemplate(
File /Users/
self.
File /Users/
None)
File /Users/
self.
File /Users/
self.rel_types)
File /Users/
custom_def)
File /Users/
if type is not None else None
File /Users/
super(NodeType, self)._
File /Users/
InvalidTypeE