- Handle config file missing better (jgranado)
This commit is contained in:
parent
0225de1248
commit
a861bb2aaf
4
pungi
4
pungi
@ -38,6 +38,10 @@ def main():
|
|||||||
config = SafeConfigParser()
|
config = SafeConfigParser()
|
||||||
config.read(opts.config)
|
config.read(opts.config)
|
||||||
|
|
||||||
|
if "default" not in config.sections():
|
||||||
|
print ("Check that the file %s exists and that it has a 'default' section" % opts.config)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
if not config.has_option('default', 'flavor'):
|
if not config.has_option('default', 'flavor'):
|
||||||
config.set('default', 'flavor', flavor)
|
config.set('default', 'flavor', flavor)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user