When locking a file, a downburst meta-data yaml file can be specified by using
the downburst-conf parameter on the command line.
+To find the downburst executable, teuthology first checks the PATH environment
+variable. If not defined, teuthology next checks for
+src/downburst/virtualenv/bin/downburst executables in the user's home
+directory, /home/ubuntu, and /home/teuthology. This can all be overridden if
+the user specifies a downburst field in the user's .teuthology.yaml file.
+
HOST KEYS:
----------
Then check in ~/src, ~ubuntu/src, and ~teuthology/src.
Return '' if no executable downburst is found.
"""
+ if config.downburst:
+ return config.downburst
path = os.environ.get('PATH', None)
if path:
for p in os.environ.get('PATH', '').split(os.pathsep):
createMe = decanonicalize_hostname(machine_name)
with tempfile.NamedTemporaryFile() as tmp:
- try:
- lfile = ctx.downburst_conf
- with open(lfile) as downb_yaml:
- lcnfg = yaml.safe_load(downb_yaml)
- if lcnfg.keys() == ['downburst']:
- lcnfg = lcnfg['downburst']
- except (TypeError, AttributeError):
- if hasattr(ctx, 'config') and ctx.config is not None:
- lcnfg = ctx.config.get('downburst', dict())
- else:
- lcnfg = {}
- except IOError:
- print "Error reading %s" % lfile
- return False
-
+ if hasattr(ctx, 'config') and ctx.config is not None:
+ lcnfg = ctx.config.get('downburst', dict())
+ else:
+ lcnfg = {}
distro = lcnfg.get('distro', os_type.lower())
distroversion = lcnfg.get('distroversion', os_version)