From 052f43c958ab654f4d659f461a49fbcfee62ce2b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 28 Jun 2011 14:15:19 -0700 Subject: [PATCH] pass owner, optional description through to summary.yaml Owner can be overridden explicitly, otherwise it's the running unix user. The description is optional and passed straight through. --- teuthology/run.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/teuthology/run.py b/teuthology/run.py index 1c0baaaeb8989..8064a55a3affd 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -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}, -- 2.39.5