From dcbf50b86cc6cf0bb7e082f9ecd09f445c1196bf Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 29 Aug 2013 16:41:09 -0700 Subject: [PATCH] nuke: get pid, owner from info.yaml (if present) Fall back to the old files if info.yaml is missing. Signed-off-by: Sage Weil --- teuthology/nuke.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/teuthology/nuke.py b/teuthology/nuke.py index 319b1f2dcea3b..5fe0632986040 100644 --- a/teuthology/nuke.py +++ b/teuthology/nuke.py @@ -328,12 +328,21 @@ def main(): level=loglevel, ) + info = {} if ctx.archive: ctx.config = config_file(ctx.archive + '/config.yaml') + ifn = os.path.join(ctx.archive, 'info.yaml') + if os.path.exists(ifn): + with file(ifn, 'r') as fd: + info = yaml.load(fd.read()) if not ctx.pid: - ctx.pid = int(open(ctx.archive + '/pid').read().rstrip('\n')) + ctx.pid = info.get('pid') + if not ctx.pid: + ctx.pid = int(open(ctx.archive + '/pid').read().rstrip('\n')) if not ctx.owner: - ctx.owner = open(ctx.archive + '/owner').read().rstrip('\n') + ctx.owner = info.get('owner') + if not ctx.owner: + ctx.owner = open(ctx.archive + '/owner').read().rstrip('\n') from teuthology.misc import read_config read_config(ctx) -- 2.39.5