Skip to content
GitLab
Explore
Sign in
Register
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
b4d3e5e7
Commit
b4d3e5e7
authored
4 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-000
: populate more test/demo data
parent
da6ff320
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SAS/TMSS/client/lib/populate.py
+14
-14
14 additions, 14 deletions
SAS/TMSS/client/lib/populate.py
SAS/TMSS/src/tmss/tmssapp/populate.py
+2
-2
2 additions, 2 deletions
SAS/TMSS/src/tmss/tmssapp/populate.py
with
16 additions
and
16 deletions
SAS/TMSS/client/lib/populate.py
+
14
−
14
View file @
b4d3e5e7
...
...
@@ -31,18 +31,18 @@ def populate_schemas(schema_dir: str=None, templates_filename: str=None):
with
open
(
templates_filepath
)
as
templates_file
:
templates
=
json
.
loads
(
templates_file
.
read
())
for
template
in
templates
:
try
:
with
open
(
os
.
path
.
join
(
schema_dir
,
template
.
pop
(
'
file_name
'
)))
as
schema_file
:
try
:
json_schema
=
json
.
loads
(
schema_file
.
read
())
with
TMSSsession
.
create_from_dbcreds_for_ldap
()
as
client
:
for
template
in
templates
:
try
:
with
open
(
os
.
path
.
join
(
schema_dir
,
template
.
pop
(
'
file_name
'
)))
as
schema_file
:
try
:
json_schema
=
json
.
loads
(
schema_file
.
read
())
template_path
=
template
.
pop
(
'
template
'
)
name
=
template
.
pop
(
'
name
'
,
json_schema
.
get
(
'
title
'
,
'
<no name>
'
))
description
=
template
.
pop
(
'
description
'
,
json_schema
.
get
(
'
description
'
,
'
<no description>
'
))
version
=
template
.
pop
(
'
version
'
,
'
1
'
)
template_path
=
template
.
pop
(
'
template
'
)
name
=
template
.
pop
(
'
name
'
,
json_schema
.
get
(
'
title
'
,
'
<no name>
'
))
description
=
template
.
pop
(
'
description
'
,
json_schema
.
get
(
'
description
'
,
'
<no description>
'
))
version
=
template
.
pop
(
'
version
'
,
'
1
'
)
with
TMSSsession
.
create_from_dbcreds_for_ldap
()
as
client
:
if
template_path
==
'
subtask_template
'
and
'
type
'
in
template
:
# override plain-text type by its url
template
[
'
type
'
]
=
client
.
get_path_as_json_object
(
'
subtask_type/
'
+
template
.
pop
(
'
type
'
))[
'
url
'
]
...
...
@@ -66,8 +66,8 @@ def populate_schemas(schema_dir: str=None, templates_filename: str=None):
description
=
description
,
version
=
version
,
**
template
)
except
Exception
as
e
:
logger
.
error
(
e
)
except
Exception
as
e
:
logger
.
error
(
e
)
except
Exception
as
e
:
logger
.
error
(
e
)
except
Exception
as
e
:
logger
.
error
(
e
)
This diff is collapsed.
Click to expand it.
SAS/TMSS/src/tmss/tmssapp/populate.py
+
2
−
2
View file @
b4d3e5e7
...
...
@@ -58,7 +58,7 @@ def populate_test_data():
# create a Test Scheduling Set UC1 under project TMSS-Commissioning
tmss_project
=
models
.
Project
.
objects
.
get
(
name
=
"
TMSS-Commissioning
"
)
for
set_nr
in
range
(
1
):
for
set_nr
in
range
(
2
):
scheduling_set_data
=
SchedulingSet_test_data
(
name
=
"
Test Scheduling Set UC1 example %s
"
%
(
set_nr
,),
project
=
tmss_project
)
scheduling_set
=
models
.
SchedulingSet
.
objects
.
create
(
**
scheduling_set_data
)
scheduling_set
.
tags
=
[
"
TEST
"
,
"
UC1
"
]
...
...
@@ -66,7 +66,7 @@ def populate_test_data():
logger
.
info
(
'
created test scheduling_set: %s
'
,
scheduling_set
.
name
)
for
unit_nr
in
range
(
1
):
for
unit_nr
in
range
(
5
):
strategy_template
=
models
.
SchedulingUnitObservingStrategyTemplate
.
objects
.
get
(
name
=
"
UC1 CTC+pipelines
"
)
...
...
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