diff options
author | Jack Neely <jjneely@ncsu.edu> | 2012-01-11 12:43:31 -0500 |
---|---|---|
committer | Jack Neely <jjneely@ncsu.edu> | 2012-01-11 12:43:31 -0500 |
commit | 91682dedf3137eaa9680439aca60cabea0624a80 (patch) | |
tree | ba5b95df8cba296baab1305af519e782bad8bb70 | |
parent | 3ed5bad691f5b90885a2c329ec90802d745f52cb (diff) | |
download | bcfg2-91682dedf3137eaa9680439aca60cabea0624a80.tar.gz bcfg2-91682dedf3137eaa9680439aca60cabea0624a80.tar.bz2 bcfg2-91682dedf3137eaa9680439aca60cabea0624a80.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.py | 10 |
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") |