From: Travis Rhoden Date: Fri, 9 Jan 2015 16:19:24 +0000 (+0000) Subject: Enable check_obsoletes in Fedora X-Git-Tag: v1.5.22-rc1~5^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5838a09f4459c7665240715afe20951918996857;p=ceph-deploy.git Enable check_obsoletes in Fedora Since Fedora ships downstream RPMs that obsolete python-ceph, those RPMs will be pulled in to resolve dependencies instead of those hosted by ceph.com, leading to package errors. To prevent this, enable check_obsoletes in the Yum priorities plugin. Fixes: 10476 Signed-off-by: Travis Rhoden --- diff --git a/ceph_deploy/hosts/fedora/install.py b/ceph_deploy/hosts/fedora/install.py index 63eae6d..a6f4385 100644 --- a/ceph_deploy/hosts/fedora/install.py +++ b/ceph_deploy/hosts/fedora/install.py @@ -15,6 +15,8 @@ def install(distro, version_kind, version, adjust_repos): if adjust_repos: install_yum_priorities(distro) + distro.conn.remote_module.enable_yum_priority_obsoletes() + logger.warning('check_obsoletes has been enabled for Yum priorities plugin') if version_kind != 'dev': remoto.process.run( diff --git a/ceph_deploy/hosts/remotes.py b/ceph_deploy/hosts/remotes.py index b0dc345..88812fc 100644 --- a/ceph_deploy/hosts/remotes.py +++ b/ceph_deploy/hosts/remotes.py @@ -313,6 +313,15 @@ def zeroing(dev): f.write(size*'\0') +def enable_yum_priority_obsoletes(path="/etc/yum/pluginconf.d/priorities.conf"): + """Configure Yum priorities to include obsoletes""" + config = ConfigParser.ConfigParser() + config.read(path) + config.set('main', 'check_obsoletes', '1') + with open(path, 'wb') as fout: + config.write(fout) + + # remoto magic, needed to execute these functions remotely if __name__ == '__channelexec__': for item in channel: # noqa