summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-11-27 01:34:45 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-11-27 01:34:45 +0000
commitbef7adca2083020a103eee4baf6fadc4c4537344 (patch)
tree7957de00211f53decc08567aa1ee440bd0b9fb26 /src
parent05e6ee19d2d6e3bc5491a690c78fdb611b3d6a57 (diff)
downloadbcfg2-bef7adca2083020a103eee4baf6fadc4c4537344.tar.gz
bcfg2-bef7adca2083020a103eee4baf6fadc4c4537344.tar.bz2
bcfg2-bef7adca2083020a103eee4baf6fadc4c4537344.zip
Make reinventory contingent on configuration activity (Resolves Ticket #280)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2546 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Client/Frame.py12
-rw-r--r--src/lib/Client/Tools/APT.py3
-rw-r--r--src/lib/Client/Tools/RPM.py3
3 files changed, 11 insertions, 7 deletions
diff --git a/src/lib/Client/Frame.py b/src/lib/Client/Frame.py
index 0c13c0e76..e79c4f410 100644
--- a/src/lib/Client/Frame.py
+++ b/src/lib/Client/Frame.py
@@ -139,9 +139,10 @@ class Frame:
mods = self.modified
mbundles = [struct for struct in self.config if struct.tag == 'Bundle' and \
[mod for mod in mods if mod in struct]]
- self.logger.info("The Following Bundles have been modifed:")
- self.logger.info([mbun.get('name') for mbun in mbundles])
- self.logger.info("")
+ if mbundles:
+ self.logger.info("The Following Bundles have been modifed:")
+ self.logger.info([mbun.get('name') for mbun in mbundles])
+ self.logger.info("")
tbm = [(t, b) for t in self.tools for b in mbundles]
for tool, bundle in tbm:
try:
@@ -196,8 +197,9 @@ class Frame:
self.times['install'] = time.time()
self.Remove()
self.times['remove'] = time.time()
- self.ReInventory()
- self.times['reinventory'] = time.time()
+ if self.modified:
+ self.ReInventory()
+ self.times['reinventory'] = time.time()
self.times['finished'] = time.time()
self.CondDisplayState('final')
diff --git a/src/lib/Client/Tools/APT.py b/src/lib/Client/Tools/APT.py
index 308f157d8..a3b56a154 100644
--- a/src/lib/Client/Tools/APT.py
+++ b/src/lib/Client/Tools/APT.py
@@ -86,7 +86,8 @@ class APT(Bcfg2.Client.Tools.PkgTool):
if len(packages) > 0:
self.logger.info('Removing packages:')
self.logger.info(pkgnames)
- self.cmd.run("apt-get remove -y --force-yes %s" % pkgnames)
+ if self.cmd.run("apt-get remove -y --force-yes %s" % pkgnames)[0] == 0:
+ self.modified += packages
self.RefreshPackages()
self.extra = self.FindExtraPackages()
diff --git a/src/lib/Client/Tools/RPM.py b/src/lib/Client/Tools/RPM.py
index efdd05a90..31a771c29 100644
--- a/src/lib/Client/Tools/RPM.py
+++ b/src/lib/Client/Tools/RPM.py
@@ -79,6 +79,7 @@ class RPM(Bcfg2.Client.Tools.PkgTool):
pkgnames = [pkg.get('name') for pkg in packages]
if len(pkgnames) > 0:
self.logger.info("Removing packages: %s" % pkgnames)
- self.cmd.run("rpm --quiet -e --allmatches %s" % " ".join(pkgnames))
+ if self.cmd.run("rpm --quiet -e --allmatches %s" % " ".join(pkgnames))[0] == 0:
+ self.modified += packages
self.RefreshPackages()
self.extra = self.FindExtraPackages()