From: Alfredo Deza Date: Fri, 26 Sep 2014 14:04:29 +0000 (-0400) Subject: when installing in debian, pin/prioritize the repo X-Git-Tag: v1.5.16~4^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=239364ccbbd4436cada57e53f3c166352c827504;p=ceph-deploy.git when installing in debian, pin/prioritize the repo Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/hosts/debian/install.py b/ceph_deploy/hosts/debian/install.py index 6263689..b6a89e8 100644 --- a/ceph_deploy/hosts/debian/install.py +++ b/ceph_deploy/hosts/debian/install.py @@ -1,3 +1,5 @@ +from urlparse import urlparse + from ceph_deploy.lib import remoto from ceph_deploy.util import pkg_managers @@ -61,6 +63,9 @@ def install(distro, version_kind, version, adjust_repos): else: raise RuntimeError('Unknown version kind: %r' % version_kind) + # set the repo priority for the right domain + fqdn = urlparse(url).hostname + distro.conn.remote_module.set_apt_priority(fqdn) distro.conn.remote_module.write_sources_list(url, codename) remoto.process.run( @@ -120,9 +125,12 @@ def mirror_install(distro, repo_url, gpg_url, adjust_repos): ] ) + # set the repo priority for the right domain + fqdn = urlparse(repo_url).hostname + distro.conn.remote_module.set_apt_priority(fqdn) + distro.conn.remote_module.write_sources_list(repo_url, distro.codename) - # Before any install, make sure we have `wget` pkg_managers.apt_update(distro.conn) packages = ( 'ceph', @@ -171,6 +179,10 @@ def repo_install(distro, repo_name, baseurl, gpgkey, **kw): safe_filename ) + # set the repo priority for the right domain + fqdn = urlparse(baseurl).hostname + distro.conn.remote_module.set_apt_priority(fqdn) + # repo is not operable until an update pkg_managers.apt_update(distro.conn)