From b372a15c33f125019282041a9b5a7443a5affd92 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 1 Jul 2020 10:32:11 -0400 Subject: [PATCH] Strip newline after decode strip on bytes in python3 does not remove newlines. Call after decode to have strip handle the newline. --- confluent_osdeploy/common/opt/confluent/bin/apiclient | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/confluent_osdeploy/common/opt/confluent/bin/apiclient b/confluent_osdeploy/common/opt/confluent/bin/apiclient index 6907cb8c..45586c6d 100644 --- a/confluent_osdeploy/common/opt/confluent/bin/apiclient +++ b/confluent_osdeploy/common/opt/confluent/bin/apiclient @@ -14,7 +14,7 @@ def get_apikey(nodename, mgr): return open('/etc/confluent/confluent.apikey').read().strip() apikey = subprocess.check_output(['/opt/confluent/bin/clortho', nodename, mgr]) if not isinstance(apikey, str): - apikey = apikey.decode('utf8') + apikey = apikey.decode('utf8').strip() with open('/etc/confluent/confluent.apikey', 'w+') as apiout: apiout.write(apikey) os.chmod('/etc/confluent/confluent.apikey', 0o600)