From bd5032268e034fdd4751924d796903721b106136 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 6 Nov 2018 15:33:04 -0500 Subject: [PATCH] Fix csv output mode of nodediscover list The changes made for tabulator broke csv output, fix that back. --- confluent_client/bin/nodediscover | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/confluent_client/bin/nodediscover b/confluent_client/bin/nodediscover index 6a78ac75..6b8b3798 100755 --- a/confluent_client/bin/nodediscover +++ b/confluent_client/bin/nodediscover @@ -182,13 +182,16 @@ def import_csv(options, session): def list_discovery(options, session): + outhandler = None if options.csv: csv.writer(sys.stdout).writerow(columns) else: outhandler = client.Tabulator(columns) for mac in list_matching_macs(options, session): print_disco(options, session, mac, outhandler) - print(outhandler.get_table()) + if outhandler: + for row in outhandler.get_table(): + print(row) def clear_discovery(options, session): for mac in list_matching_macs(options, session):