Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
4e631d0b
Commit
4e631d0b
authored
Nov 08, 2019
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed default property setting
parent
03c9c83b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
43 deletions
+3
-43
workspace.xml
drip-planner/.idea/workspace.xml
+0
-17
simple_spec_alayzer.py
drip-planner/service/simple_spec_alayzer.py
+3
-26
No files found.
drip-planner/.idea/workspace.xml
View file @
4e631d0b
...
...
@@ -2,9 +2,7 @@
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<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$/__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"
/>
</list>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
...
...
@@ -201,11 +199,6 @@
<component
name=
"XDebuggerManager"
>
<breakpoint-manager>
<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"
>
<url>
file://$PROJECT_DIR$/planner/planner.py
</url>
<line>
66
</line>
...
...
@@ -226,16 +219,6 @@
<line>
25
</line>
<option
name=
"timeStamp"
value=
"20"
/>
</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>
</breakpoint-manager>
</component>
...
...
drip-planner/service/simple_spec_alayzer.py
View file @
4e631d0b
...
...
@@ -115,7 +115,7 @@ class SimpleAnalyzer(SpecificationAnalyzer):
def
set_node_properties_for_policy
(
self
,
affected_node
,
policies
):
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:
# logging.info('Do Something')
ancestors_properties
=
tosca_helper
.
get_all_ancestors_properties
(
affected_node
,
self
.
all_node_types
,
...
...
@@ -165,29 +165,6 @@ class SimpleAnalyzer(SpecificationAnalyzer):
if
node_property
.
constraints
:
for
constraint
in
node_property
.
constraints
:
print
(
constraint
)
# if isinstance(node_property.value,
# dict) and 'required' in node_property.value and 'type' in 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
if
node_property
and
node_property
.
required
and
node_property
.
value
:
return
{
node_property
.
name
:
node_property
.
value
}
return
None
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment