mirror of
https://github.com/xcat2/confluent.git
synced 2025-01-11 18:28:11 +00:00
Strip newline after decode
strip on bytes in python3 does not remove newlines. Call after decode to have strip handle the newline.
This commit is contained in:
parent
dfa636ac4c
commit
b372a15c33
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user