From: Alfredo Deza Date: Wed, 1 May 2019 14:52:05 +0000 (-0400) Subject: gatherkeys: no need to decode, do not write binary X-Git-Tag: v2.1.0~19^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a4e9bec0bb5f7756ef270d472b848e52697cd51d;p=ceph-deploy.git gatherkeys: no need to decode, do not write binary Signed-off-by: Alfredo Deza Resolves: rm#39489 --- diff --git a/ceph_deploy/gatherkeys.py b/ceph_deploy/gatherkeys.py index 2531a8b..f90f7f2 100644 --- a/ceph_deploy/gatherkeys.py +++ b/ceph_deploy/gatherkeys.py @@ -141,9 +141,9 @@ def gatherkeys_missing(args, distro, rlogger, keypath, keytype, dest_dir): return False keyring_name_local = keytype_path_to(args, keytype) keyring_path_local = os.path.join(dest_dir, keyring_name_local) - with open(keyring_path_local, 'wb') as f: + with open(keyring_path_local, 'w') as f: for line in out: - f.write(line.decode('utf-8') + '\n') + f.write(line + '\n') return True @@ -161,7 +161,7 @@ def gatherkeys_with_mon(args, host, dest_dir): return False mon_name_local = keytype_path_to(args, "mon") mon_path_local = os.path.join(dest_dir, mon_name_local) - with open(mon_path_local, 'wb') as f: + with open(mon_path_local, 'w') as f: f.write(mon_key) rlogger = logging.getLogger(host) path_asok = ceph_deploy.util.paths.mon.asok(args.cluster, remote_hostname)