]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
worker: reload teuthology config before each job 996/head
authorZack Cerza <zack@redhat.com>
Thu, 8 Dec 2016 19:08:47 +0000 (12:08 -0700)
committerZack Cerza <zack@redhat.com>
Thu, 8 Dec 2016 19:08:47 +0000 (12:08 -0700)
The new suite_repo setting was persisting between jobs, which is...
undesirable.

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/worker.py

index c82f70b6a499ef1a57ab3fcd18267495a70040d6..e5e3efc81248995d6e0a3ccbc096142aaa73e9a3 100644 (file)
@@ -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