Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gitlab-ci
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
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
SECO Northern Europe
Yocto
infrastructure
gitlab-ci
Commits
67ba9c72
Commit
67ba9c72
authored
4 years ago
by
Tim Jaacks
Browse files
Options
Downloads
Patches
Plain Diff
Fix pathlib usage
parent
718b3708
No related branches found
Branches containing commit
No related tags found
1 merge request
!10
Fix pathlib usage
Pipeline
#8068
passed with stage
Stage:
in 18 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
integrate_into_manifest.py
+3
-5
3 additions, 5 deletions
integrate_into_manifest.py
with
3 additions
and
5 deletions
integrate_into_manifest.py
+
3
−
5
View file @
67ba9c72
...
@@ -48,7 +48,7 @@ def integrate_into_manifest(
...
@@ -48,7 +48,7 @@ def integrate_into_manifest(
# Parse manifest file
# Parse manifest file
try
:
try
:
manifest
=
etree
.
parse
(
manifest_filepath
)
manifest
=
etree
.
parse
(
manifest_filepath
.
as_posix
()
)
except
FileNotFoundError
:
except
FileNotFoundError
:
sys
.
exit
(
"
ERROR: file
'
%s
'
not found in manifest repo
"
%
manifest_file
)
sys
.
exit
(
"
ERROR: file
'
%s
'
not found in manifest repo
"
%
manifest_file
)
...
@@ -83,11 +83,9 @@ def integrate_into_manifest(
...
@@ -83,11 +83,9 @@ def integrate_into_manifest(
# We are doing this using a plain text replace action. Unfortunately
# We are doing this using a plain text replace action. Unfortunately
# all python libraries for handling XML data are not able to preserve
# all python libraries for handling XML data are not able to preserve
# the file layout, and we want a minimal diff.
# the file layout, and we want a minimal diff.
with
open
(
manifest_filepath
,
"
r
"
)
as
file
:
content
=
manifest_filepath
.
read_text
()
content
=
file
.
read
()
content
=
content
.
replace
(
old_revision
,
new_revision
)
content
=
content
.
replace
(
old_revision
,
new_revision
)
with
open
(
manifest_filepath
,
"
w
"
)
as
file
:
manifest_filepath
.
write_text
(
content
)
file
.
write
(
content
)
# Make an API request to create the gitlab.user object
# Make an API request to create the gitlab.user object
gitlab
.
auth
()
gitlab
.
auth
()
...
...
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