]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Fixes #8050 Adds a cluster.yaml that is written by interactive task
authorGregory Meno <gregory.meno@inktank.com>
Wed, 9 Apr 2014 18:54:33 +0000 (11:54 -0700)
committerGregory Meno <gregory.meno@inktank.com>
Tue, 29 Apr 2014 12:09:07 +0000 (05:09 -0700)
teuthology/task/interactive.py

index f8aa61e0e38459c32951441ac932eec04780cc77..a38411577ec995b3b8228bf889b015a731e668e1 100644 (file)
@@ -6,6 +6,8 @@ import readline
 import rlcompleter
 rlcompleter.__name__ # silence pyflakes
 import pprint
+import yaml
+import os
 
 readline.parse_and_bind('tab: complete')
 
@@ -27,6 +29,12 @@ def task(ctx, config):
         - ceph:
         - interactive:
     """
+
+    # TODO perhaps this would be better in the install task
+    if ctx.archive is not None:
+        with file(os.path.join(ctx.archive, 'cluster.yaml'), 'w') as f:
+            yaml.safe_dump({'cluster': dict([(x.name,y) for x,y in ctx.cluster.remotes.iteritems()])}, f, default_flow_style=False)
+
     pp = pprint.PrettyPrinter().pprint
     code.interact(
         banner='Ceph test interactive mode, use ctx to interact with the cluster, press control-D to exit...',