Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gitlab-ci
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
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
Clea OS
infrastructure
gitlab-ci
Commits
3514dffb
Commit
3514dffb
authored
3 years ago
by
Jonas Höppner
Browse files
Options
Downloads
Patches
Plain Diff
alphaplan_fwr.py: Silently ignore if 'output_dir is not set
parent
610e4a46
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
alphaplan_fwr.py
+12
-7
12 additions, 7 deletions
alphaplan_fwr.py
with
12 additions
and
7 deletions
alphaplan_fwr.py
+
12
−
7
View file @
3514dffb
...
...
@@ -228,13 +228,16 @@ def generate_fwr_articles(
)
jsonfile_uboot_name
=
"
alphaplan-import-uboot-{}.json
"
.
format
(
machine
)
jsonfile_uboot_local
=
os
.
path
.
join
(
outlocal_dir
,
machine
,
jsonfile_uboot_name
)
jsonfile_uboot_output
=
os
.
path
.
join
(
output_dir
,
machine
,
jsonfile_uboot_name
)
with
open
(
jsonfile_uboot_local
,
"
w
"
,
encoding
=
"
utf-8
"
)
as
jsonfile
:
json
.
dump
(
data_uboot
,
jsonfile
,
indent
=
4
)
shutil
.
copyfile
(
jsonfile_uboot_local
,
jsonfile_uboot_output
,
follow_symlinks
=
True
)
if
output_dir
is
not
None
:
jsonfile_uboot_output
=
os
.
path
.
join
(
output_dir
,
machine
,
jsonfile_uboot_name
)
shutil
.
copyfile
(
jsonfile_uboot_local
,
jsonfile_uboot_output
,
follow_symlinks
=
True
)
# Send data object to AlphaPlan webservice
ap_send_json
(
data_uboot
)
...
...
@@ -242,10 +245,12 @@ def generate_fwr_articles(
# Generate a json file from the dict/list structure for debugging
jsonfile_name
=
"
alphaplan-import-{}.json
"
.
format
(
machine
)
jsonfile_local
=
os
.
path
.
join
(
outlocal_dir
,
machine
,
jsonfile_name
)
jsonfile_output
=
os
.
path
.
join
(
output_dir
,
machine
,
jsonfile_name
)
with
open
(
jsonfile_local
,
"
w
"
,
encoding
=
"
utf-8
"
)
as
jsonfile
:
json
.
dump
(
data
,
jsonfile
,
indent
=
4
)
# Copy file to release folder as the atrifacts have already been copied
shutil
.
copyfile
(
jsonfile_local
,
jsonfile_output
,
follow_symlinks
=
True
)
if
output_dir
is
not
None
:
# Copy file to release folder as the atrifacts have already been copied
jsonfile_output
=
os
.
path
.
join
(
output_dir
,
machine
,
jsonfile_name
)
shutil
.
copyfile
(
jsonfile_local
,
jsonfile_output
,
follow_symlinks
=
True
)
# Send data object to AlphaPlan webservice
ap_send_json
(
data
)
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