aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorAndreas Hasenack <andreas@mandriva.com>2008-01-11 18:08:37 +0000
committerAndreas Hasenack <andreas@mandriva.com>2008-01-11 18:08:37 +0000
commit7203768930e92271702ae96ddfc9e27b808d28b6 (patch)
tree486838d6cb3515532e5377fdb3a7c094ec18ae50 /share
parent9e6ab1a4418445efa4081065080c59e4ab7b1ae7 (diff)
downloadmsec-7203768930e92271702ae96ddfc9e27b808d28b6.tar
msec-7203768930e92271702ae96ddfc9e27b808d28b6.tar.gz
msec-7203768930e92271702ae96ddfc9e27b808d28b6.tar.bz2
msec-7203768930e92271702ae96ddfc9e27b808d28b6.tar.xz
msec-7203768930e92271702ae96ddfc9e27b808d28b6.zip
- fix infinitely growing kdmrc with set variable AllowShutdown to None (#12821)
Diffstat (limited to 'share')
-rw-r--r--share/ConfigFile.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/share/ConfigFile.py b/share/ConfigFile.py
index 4b89d53..26a93e6 100644
--- a/share/ConfigFile.py
+++ b/share/ConfigFile.py
@@ -201,6 +201,7 @@ class ConfigFile:
lines = self.get_lines()
idx=0
value=str(value)
+ start_regexp = start
if start:
status = BEFORE
@@ -231,6 +232,10 @@ class ConfigFile:
self.modified()
log(_('set variable %s to %s in %s') % (var, value, self.path,))
return self
+ if status == BEFORE:
+ # never found the start delimiter
+ log(_('WARNING: never found regexp %s in %s, not writing changes') % (start_regexp, self.path))
+ return self
if space.search(value):
s = var + '="' + value + '"'
else: