Error if a config dir isn't specified in the configs
authorDaniel Bainton <daniel.bainton@movial.com>
Wed, 25 Mar 2009 09:36:21 +0000 (11:36 +0200)
committerDaniel Bainton <daniel.bainton@movial.com>
Wed, 25 Mar 2009 09:36:21 +0000 (11:36 +0200)
matrix/config.py

index 070e51c..00be4bd 100644 (file)
@@ -33,6 +33,11 @@ def config_dir(path=None, url=None, branch='master', optional=False):
                if path.endswith('.git'):
                        path = path[:-4]
 
+       config.config_dirs.append(path)
+       for i in config.initial_config_dirs:
+               if i not in config.config_dirs:
+                       raise Error("Config dir hasn't been specified: %s" % i)
+
        if optional and path not in config.initial_config_dirs:
                if config.debug:
                        print 'Skipping', path
@@ -51,9 +56,6 @@ def config_dir(path=None, url=None, branch='master', optional=False):
                if not isdir(path):
                        raise Error('Config dir does not exist: %s' % path)
 
-       if path not in config.initial_config_dirs:
-               config.config_dirs.append(path)
-
 def pull_config_dirs(flag):
        config.pull_config_dirs = flag