]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Pretty-up write_initial_metadata; s/run/name/
authorZack Cerza <zack@cerza.org>
Thu, 29 Aug 2013 19:07:13 +0000 (14:07 -0500)
committerZack Cerza <zack@cerza.org>
Thu, 29 Aug 2013 20:05:33 +0000 (15:05 -0500)
teuthology/run.py

index 1baa627748bbe9dc9f0fb374d58acfaf64f4260d..53a4ab92c71d27641366562e28add3ef173dcbd0 100644 (file)
@@ -128,6 +128,15 @@ def write_initial_metadata(ctx):
         with file(os.path.join(ctx.archive, 'orig.config.yaml'), 'w') as f:
             yaml.safe_dump(ctx.config, f, default_flow_style=False)
 
+        info = {
+            'name': ctx.name,
+            'description': ctx.description,
+            'owner': ctx.owner,
+            'pid': os.getpid(),
+        }
+        with file(os.path.join(ctx.archive, 'info.yaml'), 'w') as f:
+            yaml.safe_dump(info, f, default_flow_style=False)
+
 
 def main():
     from gevent import monkey
@@ -144,14 +153,6 @@ def main():
         ctx.owner = get_user()
 
     write_initial_metadata(ctx)
-    if ctx.archive is not None:
-        info = {}
-        info['pid'] = os.getpid();
-        info['description'] = ctx.description;
-        info['run'] = ctx.name;
-        info['owner'] = ctx.owner;
-        with file(os.path.join(ctx.archive, 'info.yaml'), 'w') as f:
-            yaml.safe_dump(info, f, default_flow_style=False)
 
     log.debug('test')
     raise RuntimeError('hi there')