diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2007-11-03 16:16:36 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2007-11-03 16:16:36 +0000 |
commit | cbc215ef47978b9f4a142a73e149a9977c255860 (patch) | |
tree | d20b09de2b3c7f041e0cb0cdabd175df681251ce /src/lib/Client/Tools | |
parent | 87bace51324bed0fe1d619c4da67ede9266a72dc (diff) | |
download | bcfg2-cbc215ef47978b9f4a142a73e149a9977c255860.tar.gz bcfg2-cbc215ef47978b9f4a142a73e149a9977c255860.tar.bz2 bcfg2-cbc215ef47978b9f4a142a73e149a9977c255860.zip |
Ensure that APT.py doesn't update more than once per run
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3909 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Tools')
-rw-r--r-- | src/lib/Client/Tools/APT.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/Client/Tools/APT.py b/src/lib/Client/Tools/APT.py index 269250f4b..89e01aaac 100644 --- a/src/lib/Client/Tools/APT.py +++ b/src/lib/Client/Tools/APT.py @@ -27,6 +27,7 @@ class APT(Bcfg2.Client.Tools.PkgTool): os.environ["DEBIAN_FRONTEND"] = 'noninteractive' self.installed = {} self.RefreshPackages() + self.updated = False def RefreshPackages(self): '''Refresh memory hashes of packages''' @@ -98,9 +99,9 @@ class APT(Bcfg2.Client.Tools.PkgTool): self.extra = self.FindExtraPackages() def Install(self, packages): - if not self.setup['dryrun']: - if self.setup['kevlar']: - self.cmd.run("dpkg --force-confold --configure --pending") - self.cmd.run("apt-get clean") - self.cmd.run("apt-get -q=2 -y update") + if self.setup['kevlar'] and not self.setup['dryrun'] and not self.updated: + self.cmd.run("dpkg --force-confold --configure --pending") + self.cmd.run("apt-get clean") + self.cmd.run("apt-get -q=2 -y update") + self.updated = True Bcfg2.Client.Tools.PkgTool.Install(self, packages) |