]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Save config after locking nodes, so targets are included.
authorJosh Durgin <josh.durgin@dreamhost.com>
Thu, 17 Nov 2011 19:57:07 +0000 (11:57 -0800)
committerJosh Durgin <josh.durgin@dreamhost.com>
Thu, 17 Nov 2011 19:57:07 +0000 (11:57 -0800)
teuthology/run.py
teuthology/task/internal.py

index 3455daeb23d7c400ed9d613473ae48d2217be08c..a2c3e002744464ec87f7ddfe3125ae644c5aedd6 100644 (file)
@@ -120,9 +120,6 @@ def main():
         handler.setFormatter(formatter)
         logging.getLogger().addHandler(handler)
 
-        with file(os.path.join(ctx.archive, 'config.yaml'), 'w') as f:
-            yaml.safe_dump(ctx.config, f, default_flow_style=False)
-
     log.debug('\n  '.join(['Config:', ] + yaml.safe_dump(ctx.config, default_flow_style=False).splitlines()))
 
     ctx.summary = dict(success=True)
@@ -146,6 +143,7 @@ def main():
         init_tasks.append({'internal.lock_machines': len(ctx.config['roles'])})
 
     init_tasks.extend([
+            {'internal.save_config': None},
             {'internal.check_lock': None},
             {'internal.connect': None},
             {'internal.check_conflict': None},
index 0cb9810fa6920f5c913af592f6a7a0fd5c28a01c..58e7f14e8a38fd70f899abeca7c881e8f7d0c264 100644 (file)
@@ -94,6 +94,12 @@ def lock_machines(ctx, config):
             for machine in ctx.config['targets'].iterkeys():
                 lock.unlock(ctx, machine, ctx.owner)
 
+def save_config(ctx, config):
+    log.info('Saving configuration')
+    if ctx.archive is not None:
+        with file(os.path.join(ctx.archive, 'config.yaml'), 'w') as f:
+            yaml.safe_dump(ctx.config, f, default_flow_style=False)
+
 def check_lock(ctx, config):
     log.info('Checking locks...')
     for machine in ctx.config['targets'].iterkeys():