From: Zack Cerza Date: Wed, 5 Nov 2014 21:43:35 +0000 (-0700) Subject: Also look for /etc/teuthology.yaml X-Git-Tag: 1.1.0~1078 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=53723d43f1c7416c4549b6968aee07531b0fafc1;p=teuthology.git Also look for /etc/teuthology.yaml 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 --- diff --git a/teuthology/config.py b/teuthology/config.py index 2988d1bea..3b759c0b9 100644 --- a/teuthology/config.py +++ b/teuthology/config.py @@ -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()