diff options
author | Rob Crittenden <rcritten@redhat.com> | 2011-10-14 09:36:26 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2011-10-13 16:37:12 -0400 |
commit | f4ec8a2fa45c630310d18cc36b8da459103b31cc (patch) | |
tree | 9a5ea8b5d3dff2b341deb6efcc2c2d0a850b8271 /ipapython/ipautil.py | |
parent | da4b447bd030603982e7b3d5a60888de673639fd (diff) | |
download | freeipa-f4ec8a2fa45c630310d18cc36b8da459103b31cc.tar.gz freeipa-f4ec8a2fa45c630310d18cc36b8da459103b31cc.tar.xz freeipa-f4ec8a2fa45c630310d18cc36b8da459103b31cc.zip |
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
Diffstat (limited to 'ipapython/ipautil.py')
-rw-r--r-- | ipapython/ipautil.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py index b00259494..75e8e6fdf 100644 --- a/ipapython/ipautil.py +++ b/ipapython/ipautil.py @@ -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) |