1
0
Fork 0

tuned.py: automatically add section "main" into configuration when it is missing in config-file

This commit is contained in:
Jan Vcelak 2009-10-05 18:11:12 +02:00 committed by Petr Lautrbach
parent 1afcd62f78
commit 19fd359622

View file

@ -40,6 +40,10 @@ class Tuned:
def init(self, path, cfgfile):
self.config = ConfigParser.RawConfigParser()
self.config.read(cfgfile)
if not self.config.has_section("main"):
self.config.add_section("main")
if self.config.has_option("main", "interval"):
self.interval = self.config.getint("main", "interval")
else: