From 2f79ae78a1dbbaff1b0e48ef0a69465033b829c7 Mon Sep 17 00:00:00 2001 From: Vasu Kulkarni Date: Tue, 3 Jan 2017 11:58:41 -0800 Subject: [PATCH] [RM-18410] In python3, bytes should be decoded first Signed-off-by: Vasu Kulkarni --- ceph_deploy/hosts/remotes.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ceph_deploy/hosts/remotes.py b/ceph_deploy/hosts/remotes.py index fc4255b..d0b52f6 100644 --- a/ceph_deploy/hosts/remotes.py +++ b/ceph_deploy/hosts/remotes.py @@ -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')) -- 2.47.3