From 2ab767eaa9a713c36e6a69f7ecf0f12f9ec954fd Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Tue, 26 Aug 2014 23:28:21 +0000 Subject: [PATCH] make drain-queue output actual json instead of python dict syntax --- bin/drain-queue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/drain-queue b/bin/drain-queue index 2798c8c..3a51490 100755 --- a/bin/drain-queue +++ b/bin/drain-queue @@ -31,7 +31,10 @@ logging.basicConfig(stream=sys.stderr, level=args.log_level, format='%(asctime)s %(process)d %(levelname)s %(threadName)s %(name)s.%(funcName)s(%(filename)s:%(lineno)d) %(message)s') def print_and_maybe_ack(body, message): - print(body) + # do this instead of print(body) so that output syntax is json, not python + # dict (they are similar but not identical) + print(message.body.decode('utf-8')) + if not args.no_ack: message.ack()