Bug 886178

Summary: configure yum-plugin-priorities
Product: Red Hat OpenStack Reporter: Derek Higgins <derekh>
Component: doc-Getting_Started_GuideAssignee: Stephen Gordon <sgordon>
Status: CLOSED CURRENTRELEASE QA Contact: ecs-bugs
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.1CC: aortega, apevec, sgordon, ykaul
Target Milestone: ---Keywords: Documentation, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Red_Hat_OpenStack_Preview-Getting_Started_Guide-2-web-en-US-1.0-11.el6eng Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 886177 Environment:
Last Closed: 2013-02-21 20:30:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 889306    
Bug Blocks:    

Description Derek Higgins 2012-12-11 17:17:46 UTC
details of how todo this manually need to also be put into the docs

+++ This bug was initially created as a clone of Bug #886177 +++

openstack-packstack needs to configure the openstack yum repository to have a higher priority then EPEL. 

If installed RHOS should have a higher priority.

Comment 2 Alan Pevec 2013-01-15 18:22:51 UTC
In theory, following should work:
$ yum-config-manager --setopt=rhel-server-ost-6-folsom-rpms.priority=1 --save

but this fails on RHEL 6.4 with traceback:
  File "/usr/bin/yum-config-manager", line 154, in <module>
    writeRawConfigFile(fn, 'main', ybc.conf.yumvar,
AttributeError: 'YumConf' object has no attribute 'conf'

Next best option would be to use openstack-config which is a pretty much generic INI editor, and handles .repo files just fine:
$ openstack-config --set /etc/yum.repos.d/redhat.repo rhel-server-ost-6-folsom-rpms priority 1

So in Guide, add in "1.2. Installing Utilities" after $ sudo subscription-manager list example box:

Install YUM priorities plugin:
$ sudo yum install yum-plugin-priorities

Raise priority of the Red Hat OpenStack Folsom repository:
$ openstack-config --set /etc/yum.repos.d/redhat.repo rhel-server-ost-6-folsom-rpms priority 1

Comment 3 Stephen Gordon 2013-01-24 16:56:43 UTC
(In reply to comment #2)
> In theory, following should work:
> $ yum-config-manager --setopt=rhel-server-ost-6-folsom-rpms.priority=1 --save
> 
> but this fails on RHEL 6.4 with traceback:
>   File "/usr/bin/yum-config-manager", line 154, in <module>
>     writeRawConfigFile(fn, 'main', ybc.conf.yumvar,
> AttributeError: 'YumConf' object has no attribute 'conf'
> 
> Next best option would be to use openstack-config which is a pretty much
> generic INI editor, and handles .repo files just fine:
> $ openstack-config --set /etc/yum.repos.d/redhat.repo
> rhel-server-ost-6-folsom-rpms priority 1

I did some poking and found that this actually appears to work:

yum-config-manager --setopt=rhel-server-ost-6-folsom-rpms.priority=1 --save rhel-server-ost-6-folsom-rpms

Comment 4 Stephen Gordon 2013-01-24 17:14:47 UTC
(In reply to comment #3:
> I did some poking and found that this actually appears to work:
> 
> yum-config-manager --setopt=rhel-server-ost-6-folsom-rpms.priority=1 --save
> rhel-server-ost-6-folsom-rpms

Further to that I found that by adding the instruction to install "yum-plugin-priorities" at the same time as "yum-utils" I was able to combine this into the step for enabling the repository in the first place (NB: --enable implicitly saves):

# yum-config-manager --enable rhel-server-ost-6-folsom-rpms --setopt="rhel-server-ost-6-folsom-rpms.priority=1"

Comment 5 Stephen Gordon 2013-01-24 17:19:55 UTC
commit 69e24f29fbc0c8bc9e3d9d158c49bc22587059a2

Comment 6 Stephen Gordon 2013-01-25 21:47:00 UTC
Fixed in Red_Hat_OpenStack_Preview-Getting_Started_Guide-2-web-en-US-1.0-11.el6eng