]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pass owner, optional description through to summary.yaml
authorSage Weil <sage@newdream.net>
Tue, 28 Jun 2011 21:15:19 +0000 (14:15 -0700)
committerSage Weil <sage@newdream.net>
Wed, 29 Jun 2011 19:09:38 +0000 (12:09 -0700)
Owner can be overridden explicitly, otherwise it's the running unix user.

The description is optional and passed straight through.

teuthology/run.py

index 1c0baaaeb898967af101434c36e1c41533c4d2cc..8064a55a3affd6718d40b538c748c2ff265d145e 100644 (file)
@@ -1,6 +1,7 @@
 import argparse
 import os
 import yaml
+import getpass
 
 def config_file(string):
     config = {}
@@ -40,6 +41,14 @@ def parse_args():
         metavar='DIR',
         help='path to archive results in',
         )
+    parser.add_argument(
+        '--description',
+        help='job description'
+        )
+    parser.add_argument(
+        '--owner',
+        help='job owner'
+        )
 
     args = parser.parse_args()
     return args
@@ -92,6 +101,14 @@ def main():
 
     ctx.summary = {}
 
+    if ctx.owner is not None:
+        ctx.summary['owner'] = ctx.owner
+    else:
+        ctx.summary['owner'] = getpass.getuser();
+
+    if ctx.description is not None:
+        ctx.summary['description'] = ctx.description
+
     ctx.config['tasks'][:0] = [
         {'internal.check_conflict': None},
         {'internal.base': None},