]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
[RM-18410] In python3, bytes should be decoded first 427/head
authorVasu Kulkarni <vasu@redhat.com>
Tue, 3 Jan 2017 19:58:41 +0000 (11:58 -0800)
committerVasu Kulkarni <vasu@redhat.com>
Tue, 3 Jan 2017 19:58:41 +0000 (11:58 -0800)
Signed-off-by: Vasu Kulkarni <vasu@redhat.com>
ceph_deploy/hosts/remotes.py

index fc4255bbc6a573cec241a19b5af9d8c5045c0faf..d0b52f689acc634afbfce03596e9003735c1e3a0 100644 (file)
@@ -59,12 +59,16 @@ def write_sources_list(url, codename, filename='ceph.list', mode=0o644):
 def write_sources_list_content(content, filename='ceph.list', mode=0o644):
     """add deb repo to /etc/apt/sources.list.d/ from content"""
     repo_path = os.path.join('/etc/apt/sources.list.d', filename)
+    if not isinstance(content, str):
+        content = content.decode('utf-8')
     write_file(repo_path, content.encode('utf-8'), mode)
 
 
 def write_yum_repo(content, filename='ceph.repo'):
     """add yum repo file in /etc/yum.repos.d/"""
     repo_path = os.path.join('/etc/yum.repos.d', filename)
+    if not isinstance(content, str):
+        content = content.decode('utf-8')
     write_file(repo_path, content.encode('utf-8'))