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
ad992d3a
Commit
ad992d3a
authored
Nov 08, 2019
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed missing key error
parent
4a41f8fd
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
242 additions
and
202 deletions
+242
-202
tosca_template_service.py
...flask-server/sure_tosca/service/tosca_template_service.py
+7
-2
test_default_controller.py
...a-flask-server/sure_tosca/test/test_default_controller.py
+235
-200
No files found.
sure_tosca-flask-server/sure_tosca/service/tosca_template_service.py
View file @
ad992d3a
...
@@ -42,8 +42,12 @@ def query_db(queries, db=None):
...
@@ -42,8 +42,12 @@ def query_db(queries, db=None):
updated_results
=
[]
updated_results
=
[]
for
res
in
results
:
for
res
in
results
:
if
root_key
in
res
:
if
root_key
in
res
:
key
=
res
[
root_key
]
res_copy
=
copy
.
deepcopy
(
res
)
node
=
{
key
:
res
}
key
=
res_copy
[
root_key
]
res_copy
.
pop
(
root_key
)
node
=
{
key
:
res_copy
}
else
:
logging
.
error
(
str
(
res
)
+
' has no '
+
root_key
)
updated_results
.
append
(
node
)
updated_results
.
append
(
node
)
return
updated_results
return
updated_results
return
None
return
None
...
@@ -65,6 +69,7 @@ def get_tosca_template(tosca_template_dict):
...
@@ -65,6 +69,7 @@ def get_tosca_template(tosca_template_dict):
def
get_tosca_template_dict_by_id
(
id
):
def
get_tosca_template_dict_by_id
(
id
):
tosca_template_dict
=
tosca_templates_db
.
get
(
doc_id
=
int
(
id
))
tosca_template_dict
=
tosca_templates_db
.
get
(
doc_id
=
int
(
id
))
return
tosca_template_dict
return
tosca_template_dict
...
...
sure_tosca-flask-server/sure_tosca/test/test_default_controller.py
View file @
ad992d3a
This diff is collapsed.
Click to expand it.
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