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
8650a4b3
Commit
8650a4b3
authored
Oct 22, 2019
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check if topology node has properties
parent
15d47673
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
workspace.xml
drip_planner2/.idea/workspace.xml
+5
-4
simple_spec_alayzer.py
drip_planner2/src/planner/simple_spec_alayzer.py
+10
-4
No files found.
drip_planner2/.idea/workspace.xml
View file @
8650a4b3
...
...
@@ -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"
>
...
...
drip_planner2/src/planner/simple_spec_alayzer.py
View file @
8650a4b3
...
...
@@ -22,10 +22,16 @@ class SimpleAnalyzer(SpecificationAnalyzer):
self
.
tosca_template
.
nodetemplates
,
self
.
all_node_types
,
self
.
all_custom_def
)
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'
]
# workers_num = orchestrator_nodes[0].get_property_value('workers_num')
min_num_of_vm
=
masters_num
+
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
)
...
...
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