Commit b48ad98b authored by Arnaud Fontaine's avatar Arnaud Fontaine

Fix register replace regex which was too greedy.

For example, it used to replace foo_key_file fields as well whereas only
key_file should have been replaced.
parent eb5c64a2
......@@ -251,7 +251,7 @@ def slapconfig(conf):
to_replace.append(('ipv6_interface', conf.ipv6_interface))
for key, value in to_replace:
cfg = re.sub('%s\s+=.*' % key, '%s = %s' % (key, value), cfg)
cfg = re.sub('\n\s*%s\s*=.*' % key, '\n%s = %s' % (key, value), cfg)
if not dry_run:
with open(config_path, 'w') as fout:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment