summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Neely <jjneely@ncsu.edu>2012-01-11 12:43:31 -0500
committerJack Neely <jjneely@ncsu.edu>2012-01-11 12:43:31 -0500
commit91682dedf3137eaa9680439aca60cabea0624a80 (patch)
treeba5b95df8cba296baab1305af519e782bad8bb70
parent3ed5bad691f5b90885a2c329ec90802d745f52cb (diff)
downloadbcfg2-1.1.0-stable.tar.gz
bcfg2-1.1.0-stable.tar.bz2
bcfg2-1.1.0-stable.zip
Reload all Yum configuration before any install operation.1.1.0-stable
This fixes a condition where it would take two Bcfg2 runs to properly deploy new packages. Prior, if new specification deployed a new Yum .repo file and new packages from that new repo, Bcfg2 would not be able to install the new packages until the second run. This change causes Yum to reload all of its configuration and incorperate any new .repo files before attempting to install packages.
-rw-r--r--src/lib/Client/Tools/YUMng.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/Client/Tools/YUMng.py b/src/lib/Client/Tools/YUMng.py
index fb36d3f19..8c54dc916 100644
--- a/src/lib/Client/Tools/YUMng.py
+++ b/src/lib/Client/Tools/YUMng.py
@@ -800,6 +800,16 @@ class YUMng(Bcfg2.Client.Tools.PkgTool):
states[pkg] = self.VerifyPackage(pkg, [])
# Install packages.
+ try:
+ # We want to reload all Yum configuration in case we've
+ # deployed new .repo files we should consider
+ self.yb = yum.YumBase()
+ self.yb.doTsSetup()
+ self.yb.doRpmDBSetup()
+ self.yb.doConfigSetup()
+ except Exception, e:
+ self.logger.warning("YUMng: Error Refreshing Yum Repos: %s" % e)
+
if len(install_pkgs) > 0:
self.logger.info("Attempting to install packages")