Commit 4e631d0b authored by Spiros Koulouzis's avatar Spiros Koulouzis

fixed default property setting

parent 03c9c83b
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="e478ccae-5352-4e8e-9efb-3f5cda44e877" name="Default Changelist" comment="added matplotlib"> <list default="true" id="e478ccae-5352-4e8e-9efb-3f5cda44e877" name="Default Changelist" comment="added matplotlib">
<change beforePath="$PROJECT_DIR$/../TOSCA/application_example_2_topologies.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/../TOSCA/application_example_2_topologies.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/__main__.py" beforeDir="false" afterPath="$PROJECT_DIR$/__main__.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/service/simple_spec_alayzer.py" beforeDir="false" afterPath="$PROJECT_DIR$/service/simple_spec_alayzer.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/service/simple_spec_alayzer.py" beforeDir="false" afterPath="$PROJECT_DIR$/service/simple_spec_alayzer.py" afterDir="false" />
</list> </list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
...@@ -201,11 +199,6 @@ ...@@ -201,11 +199,6 @@
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager> <breakpoint-manager>
<breakpoints> <breakpoints>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/service/simple_spec_alayzer.py</url>
<line>47</line>
<option name="timeStamp" value="1" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line"> <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/planner/planner.py</url> <url>file://$PROJECT_DIR$/planner/planner.py</url>
<line>66</line> <line>66</line>
...@@ -226,16 +219,6 @@ ...@@ -226,16 +219,6 @@
<line>25</line> <line>25</line>
<option name="timeStamp" value="20" /> <option name="timeStamp" value="20" />
</line-breakpoint> </line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/service/simple_spec_alayzer.py</url>
<line>127</line>
<option name="timeStamp" value="22" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/service/simple_spec_alayzer.py</url>
<line>160</line>
<option name="timeStamp" value="26" />
</line-breakpoint>
</breakpoints> </breakpoints>
</breakpoint-manager> </breakpoint-manager>
</component> </component>
......
...@@ -115,7 +115,7 @@ class SimpleAnalyzer(SpecificationAnalyzer): ...@@ -115,7 +115,7 @@ class SimpleAnalyzer(SpecificationAnalyzer):
def set_node_properties_for_policy(self, affected_node, policies): def set_node_properties_for_policy(self, affected_node, policies):
logging.info('Setting properties for: ' + str(affected_node.type)) logging.info('Setting properties for: ' + str(affected_node.type))
ancestors_types = tosca_helper.get_all_ancestors_types(affected_node, self.all_node_types, self.all_custom_def) # ancestors_types = tosca_helper.get_all_ancestors_types(affected_node, self.all_node_types, self.all_custom_def)
# if 'tosca.nodes.ARTICONF.Orchestrator' in ancestors_types: # if 'tosca.nodes.ARTICONF.Orchestrator' in ancestors_types:
# logging.info('Do Something') # logging.info('Do Something')
ancestors_properties = tosca_helper.get_all_ancestors_properties(affected_node, self.all_node_types, ancestors_properties = tosca_helper.get_all_ancestors_properties(affected_node, self.all_node_types,
...@@ -165,29 +165,6 @@ class SimpleAnalyzer(SpecificationAnalyzer): ...@@ -165,29 +165,6 @@ class SimpleAnalyzer(SpecificationAnalyzer):
if node_property.constraints: if node_property.constraints:
for constraint in node_property.constraints: for constraint in node_property.constraints:
print(constraint) print(constraint)
# if isinstance(node_property.value, if node_property and node_property.required and node_property.value:
# dict) and 'required' in node_property.value and 'type' in node_property.value: return {node_property.name: node_property.value}
# if node_property.value['required']:
# default_prop = {}
# if 'default' in node_property.value:
# if node_property.value['type'] == 'integer':
# default_prop = int(node_property.value['default'])
# else:
# default_prop = str(node_property.value['default'])
# elif 'constraints' in node_property.value:
# constraints = node_property.value['constraints']
# for constraint in constraints:
# for constraint_key in constraint:
# if 'equal' in constraint_key:
# if node_property.value['type'] == 'integer':
# default_prop = int(constraint[constraint_key])
# else:
# default_prop = str(constraint[constraint_key])
# name = node_property.name
# node_property = {name: default_prop}
# return node_property
# if node_property.value:
# name = node_property.name
# node_property = {name: node_property.value}
# return node_property
return None return None
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