From 724f4268fe100807e87ed9f8bf93be48d021bce4 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Thu, 8 Dec 2016 08:37:42 -0500 Subject: [PATCH] [RM-18169] remotes: add a helper to write a sources list file from contents Signed-off-by: Alfredo Deza --- ceph_deploy/hosts/remotes.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ceph_deploy/hosts/remotes.py b/ceph_deploy/hosts/remotes.py index 9dd98a0..fc4255b 100644 --- a/ceph_deploy/hosts/remotes.py +++ b/ceph_deploy/hosts/remotes.py @@ -56,6 +56,12 @@ def write_sources_list(url, codename, filename='ceph.list', mode=0o644): write_file(repo_path, content.encode('utf-8'), mode) +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) + 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) -- 2.47.3