Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
35262aa3
Commit
35262aa3
authored
3 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-917
: raise more specific json decode error
parent
5f324d14
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!634
WIP: COBALT commissioning delta
,
!540
TMSS-917: primary subtask
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/client/lib/populate.py
+4
-3
4 additions, 3 deletions
SAS/TMSS/client/lib/populate.py
with
4 additions
and
3 deletions
SAS/TMSS/client/lib/populate.py
+
4
−
3
View file @
35262aa3
...
@@ -45,11 +45,12 @@ def populate_schemas(schema_dir: str=None, templates_filename: str=None):
...
@@ -45,11 +45,12 @@ def populate_schemas(schema_dir: str=None, templates_filename: str=None):
# load all templates and schemas and prepare them for upload.
# load all templates and schemas and prepare them for upload.
# determine the dependencies, and upload the depenends first, and the rest in parallel later.
# determine the dependencies, and upload the depenends first, and the rest in parallel later.
for
template
in
templates
:
for
template
in
templates
:
with
open
(
os
.
path
.
join
(
schema_dir
,
template
[
'
file_name
'
]))
as
schema_file
:
content
=
schema_file
.
read
()
try
:
try
:
with
open
(
os
.
path
.
join
(
schema_dir
,
template
[
'
file_name
'
]))
as
schema_file
:
json_schema
=
json
.
loads
(
content
)
json_schema
=
json
.
loads
(
schema_file
.
read
())
except
Exception
as
e
:
except
Exception
as
e
:
raise
Exception
(
"
Could not decode JSON schema %s
"
%
template
[
'
file_name
'
])
from
e
raise
Exception
(
"
Could not decode JSON schema
file:
'
%s
'
\n
%s
"
%
(
template
[
'
file_name
'
]
,
content
)
)
from
e
# add template name/description/version from schema if not already in template
# add template name/description/version from schema if not already in template
template
[
'
name
'
]
=
template
.
get
(
'
name
'
,
json_schema
.
get
(
'
title
'
,
'
<no name>
'
))
template
[
'
name
'
]
=
template
.
get
(
'
name
'
,
json_schema
.
get
(
'
title
'
,
'
<no name>
'
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment