From: Dan Mick Date: Thu, 30 Jan 2014 05:48:31 +0000 (-0800) Subject: interactive.py: add handy "pp" for prettyprinting at the prompt X-Git-Tag: 1.1.0~1680^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1845a5ab68249621d057373359022fbe7fc35aaf;p=teuthology.git interactive.py: add handy "pp" for prettyprinting at the prompt Signed-off-by: Dan Mick --- diff --git a/teuthology/task/interactive.py b/teuthology/task/interactive.py index c0aa7e0a11..f8aa61e0e3 100644 --- a/teuthology/task/interactive.py +++ b/teuthology/task/interactive.py @@ -5,6 +5,7 @@ import code import readline import rlcompleter rlcompleter.__name__ # silence pyflakes +import pprint readline.parse_and_bind('tab: complete') @@ -26,11 +27,13 @@ def task(ctx, config): - ceph: - interactive: """ + pp = pprint.PrettyPrinter().pprint code.interact( banner='Ceph test interactive mode, use ctx to interact with the cluster, press control-D to exit...', # TODO simplify this local=dict( ctx=ctx, config=config, + pp=pp, ), )