From 5ce775484afc9f98f7a7235df9d9c634c48caef1 Mon Sep 17 00:00:00 2001 From: Kristiyan Gostev Date: Wed, 5 Jun 2024 11:46:03 +0300 Subject: [PATCH] Indentation error in hono_events.py Signed-off-by: Kristiyan Gostev --- quickstart/hono_events.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/quickstart/hono_events.py b/quickstart/hono_events.py index d99fdfc1..1a61def8 100644 --- a/quickstart/hono_events.py +++ b/quickstart/hono_events.py @@ -33,23 +33,23 @@ def on_start(self, event): def on_message(self, event): if event.message.body is not None: - body = json.loads(event.message.body) - if topic_filter != "" and topic_filter != body['topic']: - return - print('[event received]') - print(json.dumps(body, indent=2)) - else: - print('[empty event received]') + body = json.loads(event.message.body) + if topic_filter != "" and topic_filter != body['topic']: + return + print('[event received]') + print(json.dumps(body, indent=2)) + else: + print('[empty event received]') # Parse command line args - options, reminder = getopt.getopt(sys.argv[1:], 't:f:') - opts_dict = dict(options) - tenant_id = os.environ.get("TENANT") or opts_dict['-t'] - if '-f' in opts_dict: - topic_filter = opts_dict['-f'] - else: - topic_filter = "" +options, reminder = getopt.getopt(sys.argv[1:], 't:f:') +opts_dict = dict(options) +tenant_id = os.environ.get("TENANT") or opts_dict['-t'] +if '-f' in opts_dict: + topic_filter = opts_dict['-f'] +else: + topic_filter = "" uri = 'amqps://hono.eclipseprojects.io:15671' address = 'event/{}'.format(tenant_id)