]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Also look for /etc/teuthology.yaml
authorZack Cerza <zack.cerza@inktank.com>
Wed, 5 Nov 2014 21:43:35 +0000 (14:43 -0700)
committerZack Cerza <zack.cerza@inktank.com>
Wed, 5 Nov 2014 21:43:35 +0000 (14:43 -0700)
First we look for ~/.teuthology.yaml - if that is not found, we look for
a system-wide configuration in /etc/teuthology.yaml

Signed-off-by: Zack Cerza <zack@cerza.org>
teuthology/config.py

index 2988d1bea6d395ea66674cc1428d5a3850d83094..3b759c0b90bb7d0c194af22c59669b68f3212df9 100644 (file)
@@ -118,12 +118,17 @@ class TeuthologyConfig(YamlConfig):
         'watchdog_interval': 120,
     }
 
-    def __init__(self):
-        super(TeuthologyConfig, self).__init__(self.yaml_path)
+    def __init__(self, yaml_path=None):
+        super(TeuthologyConfig, self).__init__(yaml_path or self.yaml_path)
 
 
 class JobConfig(YamlConfig):
     pass
 
 
-config = TeuthologyConfig()
+system_config_path = '/etc/teuthology.yaml'
+if not os.path.exists(TeuthologyConfig.yaml_path) and \
+        os.path.exists(system_config_path):
+    config = TeuthologyConfig(yaml_path=system_config_path)
+else:
+    config = TeuthologyConfig()