- Handle config file missing better (jgranado)

This commit is contained in:
Jesse Keating 2007-05-15 14:14:16 -04:00 committed by Jesse Keating
parent 0225de1248
commit a861bb2aaf
1 changed files with 4 additions and 0 deletions

4
pungi
View File

@ -38,6 +38,10 @@ def main():
config = SafeConfigParser()
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'):
config.set('default', 'flavor', flavor)