From 894c80aee5897e2e6a10dc0fddc7cde4c425682b Mon Sep 17 00:00:00 2001 From: Jack Neely Date: Wed, 11 Jan 2012 12:43:31 -0500 Subject: 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) --- src/lib/Client/Tools/YUMng.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') 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") -- cgit v1.2.3-1-g7c22