summaryrefslogtreecommitdiffstats
path: root/src/lib/Client
diff options
context:
space:
mode:
authorBrian Pellin <bpellin@mcs.anl.gov>2005-01-11 21:03:54 +0000
committerBrian Pellin <bpellin@mcs.anl.gov>2005-01-11 21:03:54 +0000
commit408aa74cb13867c4c6bb0279296a5917edf63b9b (patch)
treee493033e3fe63724708f608ac0752e4ac2239a58 /src/lib/Client
parent52bf13d093df8e02ac1f0b1444bcff231a68e909 (diff)
downloadbcfg2-408aa74cb13867c4c6bb0279296a5917edf63b9b.tar.gz
bcfg2-408aa74cb13867c4c6bb0279296a5917edf63b9b.tar.bz2
bcfg2-408aa74cb13867c4c6bb0279296a5917edf63b9b.zip
Updated so stats won't include a blank <Bad> entry if the config is clean.
(Logical change 1.188) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@801 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client')
-rw-r--r--src/lib/Client/Toolset.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/Client/Toolset.py b/src/lib/Client/Toolset.py
index 41bcd783d..b3f9426a5 100644
--- a/src/lib/Client/Toolset.py
+++ b/src/lib/Client/Toolset.py
@@ -117,17 +117,20 @@ class Toolset(object):
if len([key for key, val in self.structures.iteritems() if not val]) == 0:
stats.set('state', 'clean')
+ dirty = 0
else:
stats.set('state', 'dirty')
+ dirty = 1
#stats.set('time', asctime(localtime()))
# List bad elements of the configuration
- bad_elms = SubElement(stats, "Bad")
- for elm in [key for key,val in self.states.iteritems() if not val]:
- if elm.get('name') == None:
- SubElement(bad_elms, elm.tag)
- else:
- SubElement(bad_elms, elm.tag, name=elm.get('name'))
+ if dirty:
+ bad_elms = SubElement(stats, "Bad")
+ for elm in [key for key,val in self.states.iteritems() if not val]:
+ if elm.get('name') == None:
+ SubElement(bad_elms, elm.tag)
+ else:
+ SubElement(bad_elms, elm.tag, name=elm.get('name'))
return stats