]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
gatherkeys: no need to decode, do not write binary
authorAlfredo Deza <adeza@redhat.com>
Wed, 1 May 2019 14:52:05 +0000 (10:52 -0400)
committerAlfredo Deza <adeza@redhat.com>
Wed, 1 May 2019 18:13:07 +0000 (14:13 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
Resolves: rm#39489

ceph_deploy/gatherkeys.py

index 2531a8b87ab60e4a7d194887bcd578cf34c0f302..f90f7f256a4d22dfc6ac0738fe468f91f0529c60 100644 (file)
@@ -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)