From efcac0b181f4676948fbc2c6017e4207011cb442 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 19 Jul 2019 14:09:51 -0400 Subject: [PATCH] Fix nodesensors -n with csv --- confluent_client/bin/nodesensors | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/confluent_client/bin/nodesensors b/confluent_client/bin/nodesensors index c86e1256..ccf8b917 100755 --- a/confluent_client/bin/nodesensors +++ b/confluent_client/bin/nodesensors @@ -158,7 +158,7 @@ def sensorpass(showout=True, appendtime=False): def format_csv(csvwriter, orderedsensors, resdata, showtime=True): for nodekey in resdata: if showtime: - if showtime.is_integer(): + if isinstance(showtime, int): rowdata = [time.strftime('%Y-%m-%dT%H:%M:%S'), nodekey] else: rowdata = [time.strftime('%Y-%m-%dT%H:%M:%S.') + @@ -199,7 +199,7 @@ def main(): orderedsensors.append(name) orderedsensors.sort() for name in orderedsensors: - headernames.append(sensorheaders[name]) + headernames.append(sensorheaders[name].encode('utf-8')) if options.csv: linebyline = False csvwriter = csv.writer(sys.stdout)