From: Alfredo Deza Date: Thu, 5 Dec 2013 16:58:53 +0000 (-0500) Subject: centos and debian support for local_mirror X-Git-Tag: v1.5.0~10^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=85fb0b0edd8300e6ecf06cc96f681ad5db645aad;p=ceph-deploy.git centos and debian support for local_mirror Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/hosts/centos/install.py b/ceph_deploy/hosts/centos/install.py index 723b328..0f336c3 100644 --- a/ceph_deploy/hosts/centos/install.py +++ b/ceph_deploy/hosts/centos/install.py @@ -99,6 +99,7 @@ def install_epel(distro): def mirror_install(distro, repo_url, gpg_url, adjust_repos): repo_url = repo_url.strip('/') # Remove trailing slashes + gpg_url_path = gpg_url.split('file://')[-1] # Remove file if present pkg_managers.yum_clean(distro.conn) @@ -108,7 +109,7 @@ def mirror_install(distro, repo_url, gpg_url, adjust_repos): [ 'rpm', '--import', - gpg_url, + gpg_url_path, ] ) diff --git a/ceph_deploy/hosts/debian/install.py b/ceph_deploy/hosts/debian/install.py index 63210a9..eb8a0d7 100644 --- a/ceph_deploy/hosts/debian/install.py +++ b/ceph_deploy/hosts/debian/install.py @@ -95,25 +95,28 @@ def install(distro, version_kind, version, adjust_repos): def mirror_install(distro, repo_url, gpg_url, adjust_repos): repo_url = repo_url.strip('/') # Remove trailing slashes + gpg_path = gpg_url.split('file://')[-1] if adjust_repos: - process.run( - distro.conn, - [ - 'wget', - '-O', - 'release.asc', - gpg_url, - ], - stop_on_nonzero=False, - ) - + if not gpg_url.startswith('file://'): + process.run( + distro.conn, + [ + 'wget', + '-O', + 'release.asc', + gpg_url, + ], + stop_on_nonzero=False, + ) + + gpg_file = 'release.asc' if not gpg_url.startswith('file://') else gpg_path process.run( distro.conn, [ 'apt-key', 'add', - 'release.asc' + gpg_file, ] )