Permalink
Browse files

Display an error message when config file has syntay errors

  • Loading branch information...
1 parent eea6936 commit 3a13b89a79eaad92fad88b3bffd1da5608d793e9 @tobami committed Oct 12, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 littlechef/runner.py
@@ -301,7 +301,7 @@ def list_plugins():
def _check_appliances():
- """Look around and return True or False based on whether we are in a
+ """Looks around and return True or False based on whether we are in a
kitchen
"""
filenames = os.listdir(os.getcwd())
@@ -313,9 +313,12 @@ def _check_appliances():
def _readconfig():
- """Configure environment"""
+ """Configures environment variables"""
config = ConfigParser.SafeConfigParser()
- found = config.read([CONFIGFILE, 'auth.cfg'])
+ try:
+ found = config.read([CONFIGFILE, 'auth.cfg'])
+ except ConfigParser.ParsingError as e:
+ abort(str(e))
if not len(found):
abort('No config.cfg file found in the current directory')

0 comments on commit 3a13b89

Please sign in to comment.