From 41f21b7bb315a6cb8ceef0d4d065b90869a5d848 Mon Sep 17 00:00:00 2001 From: Jack Neely Date: Wed, 18 Aug 2010 21:00:27 +0000 Subject: YUMng: All gpg-pubkey must be in the proper work queue to be installed. gpg-pubkeys are not packages, yet we treat them as so. They require special handling for all install/upgrades/etc. This corrects a condition where gpg-pubkeys were "upgraded" rather than "installed." git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@6027 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Client/Tools/YUMng.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/lib/Client/Tools/YUMng.py') diff --git a/src/lib/Client/Tools/YUMng.py b/src/lib/Client/Tools/YUMng.py index 361b05d03..42b291141 100644 --- a/src/lib/Client/Tools/YUMng.py +++ b/src/lib/Client/Tools/YUMng.py @@ -563,12 +563,18 @@ class YUMng(Bcfg2.Client.Tools.RPMng.RPMng): entry is set to True. """ - self.logger.info('Running YUMng.Install()') + self.logger.debug('Running YUMng.Install()') install_pkgs = [] gpg_keys = [] upgrade_pkgs = [] + def queuePkg(pkg, inst, queue): + if pkg.get('name') == 'gpg-pubkey': + gpg_keys.append(inst) + else: + queue.append(inst) + # Remove extra instances. # Can not reverify because we don't have a package entry. if self.extra_instances is not None and len(self.extra_instances) > 0: @@ -592,15 +598,12 @@ class YUMng(Bcfg2.Client.Tools.RPMng.RPMng): if self.FixInstance(inst, self.instance_status[inst]): if self.instance_status[inst].get('installed', False) \ == False: - if pkg.get('name') == 'gpg-pubkey': - gpg_keys.append(inst) - else: - install_pkgs.append(inst) + queuePkg(pkg, inst, install_pkgs) elif self.instance_status[inst].get('version_fail', \ False) == True: - upgrade_pkgs.append(inst) + queuePkg(pkg, inst, upgrade_pkgs) else: - install_pkgs.append(pkg) + queuePkg(pkg, inst, install_pkgs) # Install GPG keys. # Alternatively specify the required keys using 'gpgkey' in the -- cgit v1.2.3-1-g7c22