summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Laszlo <tim.laszlo@gmail.com>2012-06-14 09:21:24 -0500
committerTim Laszlo <tim.laszlo@gmail.com>2012-06-14 09:21:37 -0500
commit772ea973da6b425e9f2336ed64cb2fd1081b3256 (patch)
treeb463804d8d0d6395ccc27de9aee8f8f27a5195b6
parente0de3fe9d506c300edd46e11494e0af85e527b5b (diff)
downloadbcfg2-772ea973da6b425e9f2336ed64cb2fd1081b3256.tar.gz
bcfg2-772ea973da6b425e9f2336ed64cb2fd1081b3256.tar.bz2
bcfg2-772ea973da6b425e9f2336ed64cb2fd1081b3256.zip
Client Stats: Add good entries to the statistics sent to the server
-rw-r--r--src/lib/Bcfg2/Client/Frame.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/Bcfg2/Client/Frame.py b/src/lib/Bcfg2/Client/Frame.py
index 56ac80695..a8bcb69bf 100644
--- a/src/lib/Bcfg2/Client/Frame.py
+++ b/src/lib/Bcfg2/Client/Frame.py
@@ -446,7 +446,8 @@ class Frame:
total=str(len(self.states)),
version='2.0',
revision=self.config.get('revision', '-1'))
- good = len([key for key, val in list(self.states.items()) if val])
+ good_entries = [key for key, val in list(self.states.items()) if val]
+ good = len(good_entries)
stats.set('good', str(good))
if len([key for key, val in list(self.states.items()) if not val]) == 0:
stats.set('state', 'clean')
@@ -455,6 +456,7 @@ class Frame:
# List bad elements of the configuration
for (data, ename) in [(self.modified, 'Modified'), (self.extra, "Extra"), \
+ (good_entries, "Good"),
([entry for entry in self.states if not \
self.states[entry]], "Bad")]:
container = Bcfg2.Client.XML.SubElement(stats, ename)