Skip to content
This repository was archived by the owner on Jan 26, 2022. It is now read-only.

Commit 04bdf8e

Browse files
author
Mike Blume
committed
move display logic into else clause.
1 parent 1af2380 commit 04bdf8e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

stormkafkamon/monitor.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,17 @@ def main():
8686

8787
try:
8888
zk_data = process(zc.spouts(options.spoutroot, options.topology))
89-
if options.postjson:
90-
post_json(options.postjson, zk_data)
91-
else:
92-
display(zk_data, true_or_false_option(options.friendly))
9389
except ZkError, e:
9490
print 'Failed to access Zookeeper: %s' % str(e)
9591
return 1
9692
except ProcessorError, e:
9793
print 'Failed to process: %s' % str(e)
9894
return 1
95+
else:
96+
if options.postjson:
97+
post_json(options.postjson, zk_data)
98+
else:
99+
display(zk_data, true_or_false_option(options.friendly))
99100

100101
return 0
101102

0 commit comments

Comments
 (0)