From d9d57c015fc44c84c934efda4915d30a3912286f Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Tue, 16 Oct 2018 23:17:09 -0400 Subject: [PATCH] Remove implicit conversion of nontypes to '' and convert data to string --- client-common/zkhandler.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client-common/zkhandler.py b/client-common/zkhandler.py index 0c7c487f..f3988e73 100644 --- a/client-common/zkhandler.py +++ b/client-common/zkhandler.py @@ -43,13 +43,11 @@ def writedata(zk_conn, kv): # Proceed one KV pair at a time for key in sorted(kv): data = kv[key] - if not data: - data = '' # Check if this key already exists or not if not zk_conn.exists(key): # We're creating a new key - zk_transaction.create(key, data.encode('ascii')) + zk_transaction.create(key, str(data).encode('ascii')) else: # We're updating a key with version validation orig_data = zk_conn.get(key) @@ -59,7 +57,7 @@ def writedata(zk_conn, kv): new_version = version + 1 # Update the data - zk_transaction.set_data(key, data.encode('ascii')) + zk_transaction.set_data(key, str(data).encode('ascii')) # Set up the check try: