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
bf40680e
Commit
bf40680e
authored
Apr 17, 2019
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix typos
parent
0032c1bc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
dum_planner.cpython-36.pyc
...anner2/src/planner/__pycache__/dum_planner.cpython-36.pyc
+0
-0
dum_planner.py
drip_planner2/src/planner/dum_planner.py
+10
-8
No files found.
drip_planner2/src/planner/__pycache__/dum_planner.cpython-36.pyc
View file @
bf40680e
No preview for this file type
drip_planner2/src/planner/dum_planner.py
View file @
bf40680e
...
...
@@ -10,13 +10,14 @@ class DumpPlanner:
topology_template_names
=
[
'topologyTemplate'
]
node_template_names
=
[
'nodeTemplates'
]
requirement_names
=
[
'requirements'
]
type_names
=
[
'type'
]
def
__init__
(
self
,
service_templaete_file_path
):
dict_tpl
=
self
.
load_file
(
service_templaete_file_path
)
requirements
=
self
.
get_all_requirements
(
dict_tpl
)
unmet_requirements
=
self
.
get_unmet_requirements
(
requirements
)
print
(
requirements
)
print
(
unmet_
requirements
)
# yaml_dict_tpl = self.trnsform_to_tosca(yaml_dict_tpl)
...
...
@@ -61,6 +62,10 @@ class DumpPlanner:
return
all_requirements
def
get_unmet_requirements
(
self
,
requirements
):
for
requirement
in
requirements
:
requirement_type
=
self
.
get_requirement_type
(
requirement
)
print
(
requirement_type
)
def
get_service_template
(
self
,
dict_tpl
):
return
self
.
find
(
dict_tpl
,
self
.
service_template_names
)
...
...
@@ -74,14 +79,11 @@ class DumpPlanner:
def
get_requirements
(
self
,
dict_tpl
):
return
self
.
find
(
dict_tpl
,
self
.
requirement_names
)
def
get_requirement_type
(
self
,
dict_req
):
return
self
.
find
(
dict_req
,
self
.
type_names
)
def
find
(
self
,
dict_tpl
,
names
):
if
dict_tpl
:
for
name
in
names
:
if
(
name
in
dict_tpl
):
return
dict_tpl
[
name
]
\ No newline at end of file
def
get_unmet_requirements
(
self
,
requirements
):
for
requirement
in
requirement
:
print
(
requirement
)
\ No newline at end of file
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