From 1845a5ab68249621d057373359022fbe7fc35aaf Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Wed, 29 Jan 2014 21:48:31 -0800 Subject: [PATCH] interactive.py: add handy "pp" for prettyprinting at the prompt Signed-off-by: Dan Mick --- teuthology/task/interactive.py | 3 +++ 1 file changed, 3 insertions(+) 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, ), ) -- 2.39.5