diff options
author | Brian Pellin <bpellin@mcs.anl.gov> | 2005-01-11 21:03:54 +0000 |
---|---|---|
committer | Brian Pellin <bpellin@mcs.anl.gov> | 2005-01-11 21:03:54 +0000 |
commit | 408aa74cb13867c4c6bb0279296a5917edf63b9b (patch) | |
tree | e493033e3fe63724708f608ac0752e4ac2239a58 /src | |
parent | 52bf13d093df8e02ac1f0b1444bcff231a68e909 (diff) | |
download | bcfg2-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')
-rw-r--r-- | src/lib/Client/Toolset.py | 15 |
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 |