tuned.py: automatically add section "main" into configuration when it is missing in config-file
This commit is contained in:
parent
1afcd62f78
commit
19fd359622
1 changed files with 4 additions and 0 deletions
4
tuned.py
4
tuned.py
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue