aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageialinux-online.org>2017-05-14 08:53:06 +0200
committerPapoteur <papoteur@mageialinux-online.org>2017-05-14 08:53:06 +0200
commitedb212df73e8970cc3682ddeabc9275381a7dffa (patch)
treeff7c152c1d5446c2ff996002bed6100ea0ff3d02
parent5333a0f09de2ca71fb8a885905dc57631d090f1b (diff)
downloadmsec-edb212df73e8970cc3682ddeabc9275381a7dffa.tar
msec-edb212df73e8970cc3682ddeabc9275381a7dffa.tar.gz
msec-edb212df73e8970cc3682ddeabc9275381a7dffa.tar.bz2
msec-edb212df73e8970cc3682ddeabc9275381a7dffa.tar.xz
msec-edb212df73e8970cc3682ddeabc9275381a7dffa.zip
close properly file handler when saving
-rwxr-xr-xsrc/msec/config.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/msec/config.py b/src/msec/config.py
index 906f434..ff08b88 100755
--- a/src/msec/config.py
+++ b/src/msec/config.py
@@ -299,6 +299,7 @@ class MsecConfig:
else:
value = '"%s"' % value
print("%s=%s" % (option, value), file=fd)
+ fd.close()
return True
# }}}
@@ -392,6 +393,7 @@ class ExceptionConfig:
self.log.debug("Skipping %s" % option)
else:
print("%s %s" % (option, value), file=fd)
+ fd.close()
return True
# }}}
@@ -498,5 +500,6 @@ class PermConfig(MsecConfig):
else:
force = ""
print("%s\t%s.%s\t%s%s\t%s" % (file, user, group, perm, force, acl), file=fd)
+ fd.close()
return True
# }}}