From 43480c2e3b6767a2d0c4e16b2bb58f13721e23ce Mon Sep 17 00:00:00 2001
From: Jarrod Johnson <jjohnson2@lenovo.com>
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)