From: Zack Cerza Date: Thu, 8 Dec 2016 19:08:47 +0000 (-0700) Subject: worker: reload teuthology config before each job X-Git-Tag: 1.1.0~486^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=df1436f0e57d8db2c1f745c5c8a41290ea402b6b;p=teuthology.git worker: reload teuthology config before each job The new suite_repo setting was persisting between jobs, which is... undesirable. Signed-off-by: Zack Cerza --- diff --git a/teuthology/worker.py b/teuthology/worker.py index c82f70b6..e5e3efc8 100644 --- a/teuthology/worker.py +++ b/teuthology/worker.py @@ -46,6 +46,18 @@ def stop(): sys.exit(0) +def load_config(ctx=None): + teuth_config.load() + if ctx is not None: + if not os.path.isdir(ctx.archive_dir): + sys.exit("{prog}: archive directory must exist: {path}".format( + prog=os.path.basename(sys.argv[0]), + path=ctx.archive_dir, + )) + else: + teuth_config.archive_base = ctx.archive_dir + + def install_except_hook(): """ Install an exception hook that first logs any uncaught exception, then @@ -71,13 +83,7 @@ def main(ctx): install_except_hook() - if not os.path.isdir(ctx.archive_dir): - sys.exit("{prog}: archive directory must exist: {path}".format( - prog=os.path.basename(sys.argv[0]), - path=ctx.archive_dir, - )) - else: - teuth_config.archive_base = ctx.archive_dir + load_config(ctx=ctx) set_config_attr(ctx) @@ -103,6 +109,8 @@ def main(ctx): elif sentinel(stop_file_path): stop() + load_config() + job = connection.reserve(timeout=60) if job is None: continue