]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
nuke: get pid, owner from info.yaml (if present)
authorSage Weil <sage@inktank.com>
Thu, 29 Aug 2013 23:41:09 +0000 (16:41 -0700)
committerSage Weil <sage@inktank.com>
Fri, 30 Aug 2013 17:02:27 +0000 (10:02 -0700)
Fall back to the old files if info.yaml is missing.

Signed-off-by: Sage Weil <sage@inktank.com>
teuthology/nuke.py

index 319b1f2dcea3b567cddf3c41fc2f11b704c27bd0..5fe0632986040e41b18fb16bdaad230c87a572c0 100644 (file)
@@ -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)