summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Neely <jjneely@ncsu.edu>2012-01-11 12:43:31 -0500
committerSol Jerome <sol.jerome@gmail.com>2012-01-11 17:27:25 -0600
commit894c80aee5897e2e6a10dc0fddc7cde4c425682b (patch)
tree155a50b74cdd1e3851d5553546efdf36f8c23a8d /src
parenta8ecc8eb162754991270c9e866af54489251f2dc (diff)
downloadbcfg2-894c80aee5897e2e6a10dc0fddc7cde4c425682b.tar.gz
bcfg2-894c80aee5897e2e6a10dc0fddc7cde4c425682b.tar.bz2
bcfg2-894c80aee5897e2e6a10dc0fddc7cde4c425682b.zip
Reload all Yum configuration before any install operation.
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. (cherry picked from commit 059d37b2c385a848764c631d0d735a51908de0cf)
Diffstat (limited to 'src')
-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 edbcccb6e..e57a7a465 100644
--- a/src/lib/Client/Tools/YUMng.py
+++ b/src/lib/Client/Tools/YUMng.py
@@ -842,6 +842,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")