Commit 8650a4b3 authored by Spiros Koulouzis's avatar Spiros Koulouzis

check if topology node has properties

parent 15d47673
......@@ -2,12 +2,8 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="462ede19-adfe-472b-975e-fefefa973fe0" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/../TOSCA/application_example_output.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/../TOSCA/application_example_output.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../TOSCA/application_example_updated.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/../TOSCA/application_example_updated.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../TOSCA/types/nodes.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/../TOSCA/types/nodes.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/planner/simple_spec_alayzer.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/planner/simple_spec_alayzer.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/rpc_server.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/rpc_server.py" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
......@@ -324,6 +320,11 @@
<line>99</line>
<option name="timeStamp" value="303" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/src/planner/simple_spec_alayzer.py</url>
<line>24</line>
<option name="timeStamp" value="304" />
</line-breakpoint>
</breakpoints>
<default-breakpoints>
<breakpoint type="python-exception">
......
......@@ -22,10 +22,16 @@ class SimpleAnalyzer(SpecificationAnalyzer):
self.tosca_template.nodetemplates, self.all_node_types,
self.all_custom_def)
masters_num = orchestrator_nodes[0].entity_tpl['properties']['masters_num']
workers_num = orchestrator_nodes[0].entity_tpl['properties']['workers_num']
# workers_num = orchestrator_nodes[0].get_property_value('workers_num')
min_num_of_vm = masters_num + workers_num
if 'properties' in orchestrator_nodes[0].entity_tpl:
if 'masters_num' in orchestrator_nodes[0].entity_tpl['properties']:
masters_num = orchestrator_nodes[0].entity_tpl['properties']['masters_num']
if 'workers_num' in orchestrator_nodes[0].entity_tpl['properties']:
workers_num = orchestrator_nodes[0].entity_tpl['properties']['workers_num']
else:
masters_num = orchestrator_nodes[0].get_property_value('masters_num')
workers_num = orchestrator_nodes[0].get_property_value('workers_num')
topology_nodes = tosca_util.get_nodes_by_type('tosca.nodes.ARTICONF.VM.topology',
self.tosca_template.nodetemplates, self.all_node_types,
self.all_custom_def)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment