From: Alfredo Deza Date: Thu, 8 Dec 2016 13:37:42 +0000 (-0500) Subject: [RM-18169] remotes: add a helper to write a sources list file from contents X-Git-Tag: v1.5.37~3^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=724f4268fe100807e87ed9f8bf93be48d021bce4;p=ceph-deploy.git [RM-18169] remotes: add a helper to write a sources list file from contents Signed-off-by: Alfredo Deza --- 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)