Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
L
load_leveller
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lukas Weber
load_leveller
Commits
f321abba
Commit
f321abba
authored
Jun 15, 2020
by
Lukas Weber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix path handling bugs in lljobcat
parent
9507dd11
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
python/lljobcat
python/lljobcat
+14
-4
No files found.
python/lljobcat
View file @
f321abba
...
...
@@ -14,11 +14,13 @@ parser.add_argument('-n', '--no-merge', action='store_true', help='skip the merg
parser
.
add_argument
(
'-c'
,
'--copy-jobfile'
,
action
=
'store_true'
,
help
=
'copy <jobfiles> to the output in a .scripts directory.'
)
args
=
parser
.
parse_args
()
os
.
makedirs
(
os
.
path
.
dirname
(
args
.
output
),
exist_ok
=
True
)
os
.
makedirs
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
args
.
output
)
),
exist_ok
=
True
)
if
args
.
copy_jobfile
:
job_archive_dir
=
os
.
path
.
splitext
(
args
.
output
)[
0
]
+
'.scripts'
os
.
makedirs
(
job_archive_dir
,
exist_ok
=
True
)
used_short_jobnames
=
set
()
tasks
=
[]
for
jobname
in
args
.
jobfiles
:
try
:
...
...
@@ -32,9 +34,17 @@ for jobname in args.jobfiles:
tasks
+=
res
if
args
.
copy_jobfile
:
shutil
.
copyfile
(
jobname
,
os
.
path
.
join
(
job_archive_dir
,
jobname
))
except
FileNotFoundError
:
print
(
'File not found for "{}". Skipping...'
.
format
(
jobname
))
short_jobname
=
os
.
path
.
basename
(
jobname
)
if
short_jobname
in
used_short_jobnames
:
idx
=
2
while
"{}_{}"
.
format
(
short_jobname
,
idx
)
in
used_short_jobnames
:
idx
+=
1
short_jobname
=
"{}_{}"
.
format
(
short_jobname
,
idx
)
used_short_jobnames
.
add
(
short_jobname
)
shutil
.
copyfile
(
jobname
,
os
.
path
.
join
(
job_archive_dir
,
short_jobname
))
except
FileNotFoundError
as
e
:
print
(
'File "{}" not found for "{}". Skipping...'
.
format
(
e
.
filename
,
jobname
))
with
open
(
args
.
output
,
'w'
)
as
outfile
:
json
.
dump
(
tasks
,
outfile
,
indent
=
0
)
...
...
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