Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
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
mediaserver
envsetup
Commits
e68faf97
Commit
e68faf97
authored
6 years ago
by
Nicolas KAROLAK
Browse files
Options
Downloads
Patches
Plain Diff
set_conf: fix condition | refs
#27883
parent
584f20c9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
utils.py
+2
-1
2 additions, 1 deletion
utils.py
with
2 additions
and
1 deletion
utils.py
+
2
−
1
View file @
e68faf97
...
...
@@ -236,9 +236,10 @@ def set_conf(key: str, value: str, override: bool = False) -> bool:
regex
=
re
.
compile
(
r
"
^
"
+
key
.
upper
()
+
"
=(.*)$
"
,
flags
=
re
.
M
)
match
=
regex
.
search
(
conf
)
if
match
and
override
:
# override option
conf
=
regex
.
sub
(
"
{}=
'
{}
'"
.
format
(
key
.
upper
(),
str
(
value
)),
conf
)
state
=
True
el
se
:
el
if
not
match
:
# add option
conf
=
conf
+
"
\n
{}=
'
{}
'
\n
"
.
format
(
key
.
upper
(),
str
(
value
))
state
=
True
...
...
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