mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 15:40:01 -06:00
Handle an empty value in a name/value pair in config_replace_variables()
This would blow up if you tried to append a value to an entry that looked like: NAME= https://fedorahosted.org/freeipa/ticket/1983
This commit is contained in:
parent
da4b447bd0
commit
f4ec8a2fa4
@ -1235,7 +1235,9 @@ $)''', re.VERBOSE)
|
||||
old_values[option] = value
|
||||
if appendvars and option in appendvars:
|
||||
# append new value unless it is already existing in the original one
|
||||
if value.find(appendvars[option]) == -1:
|
||||
if not value:
|
||||
new_line = u"%s=%s\n" % (option, appendvars[option])
|
||||
elif value.find(appendvars[option]) == -1:
|
||||
new_line = u"%s=%s %s\n" % (option, value, appendvars[option])
|
||||
old_values[option] = value
|
||||
new_config.write(new_line)
|
||||
|
Loading…
Reference in New Issue
Block a user