I’ve been working quite heavily on the Yum provider in 0.10 over the
past couple weeks and have reached a point where I’m looking for some
testing and feedback. The branch is at
For testing purposes the extent of the changes are confined to
If anyone has a spare server and time to copy those overtop of an
existing gem install of 0.10 and give their cookbooks a whirl I’d be
As for the changes, notable yum_package improvements include:
- YumCache speed improvements when installing/upgrading/removing
multiple packages - now only the installed packages are refreshed
after each action during a Chef client run. Also, data is now loaded
on demand - getting rid of a useless cache refresh at the end of the
Chef client run.
- Ability to flush the YumCache via a flush_cache [ :before, :after ]
attribute that will dump the cache before the current resource is
loaded and/or after a package is installed/upgraded/removed. This is
for users installing yum repositories as packages.
- Ability to downgrade packages via a allow_downgrade true/false
attribute that will, if necessary based on the candidate and installed
versions, allow a call to ‘yum downgrade’ rather than ‘yum install’ to
successfully complete the install.
- Ability to pass the package arch in the package_name like
"strace.i386" (‘yum list’ outputs package names like this)
- Improved error handling in parsing yum-dump.py output and package
version handling. We ensure that the version to install is actually
newer than the installed version.
- Nearly rewritten yum-dump.py with improved error handling and output options.
- Added some RPM related utility classes used in the improvements and
useful for future work.
- A whole ton of unit tests to cover (hopefully) all of the work,
including the fun to test YumCache itself.
Ticket fix list:
CHEF-1287: speed up yum provider
CHEF-1245: Yum package provider fails poorly when it encounters
unexpected output from yum-dump.py
CHEF-1063: yum query/yum-dump.py fails when a locally-compiled Python
is in $PATH
CHEF-2272: yum-dump.py - commas are valid in package names
CHEF-2280: general yum-dump.py improvements
CHEF-311: yum provider - better cache refresh
CHEF-2283: yum/rpm providers - rpm version handling
CHEF-1819: Chef isn’t recognizing yum .x86_64 syntax
CHEF-2085: YumCache needs unit tests
CHEF-2301: general yum provider improvements
CHEF-2330: yum provider - allow flushing of cache
CHEF-1790: Modify package/yum.rb upgrade_package to support
"downgrade" in certain situations
Matthew Kent | http://magoazul.com