]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
Enable check_obsoletes in Fedora
authorTravis Rhoden <trhoden@redhat.com>
Fri, 9 Jan 2015 16:19:24 +0000 (16:19 +0000)
committerTravis Rhoden <trhoden@redhat.com>
Fri, 9 Jan 2015 16:19:24 +0000 (16:19 +0000)
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 <trhoden@redhat.com>
ceph_deploy/hosts/fedora/install.py
ceph_deploy/hosts/remotes.py

index 63eae6d8578e4a312107022cbd546417c9314efd..a6f4385cd3dabdf63cc2c739e6e93272e12ed973 100644 (file)
@@ -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(
index b0dc345691b6ad08e077d9991dd2555139f9a287..88812fc34d1c3478b912c3c384e4376ae491615f 100644 (file)
@@ -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