From f6f6f5a331f9c9419df6cba258eab2f680962307 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Wed, 12 Jan 2005 19:30:23 +0000 Subject: add modified support 2005/01/12 10:44:14-06:00 anl.gov!desai pylint cleanups (Logical change 1.190) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@809 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Client/Toolset.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/Client/Toolset.py b/src/lib/Client/Toolset.py index b3f9426a5..0a89fc4a6 100644 --- a/src/lib/Client/Toolset.py +++ b/src/lib/Client/Toolset.py @@ -9,7 +9,7 @@ from stat import S_ISVTX, S_ISGID, S_ISUID, S_IXUSR, S_IWUSR, S_IRUSR, S_IXGRP from stat import S_IWGRP, S_IRGRP, S_IXOTH, S_IWOTH, S_IROTH, ST_MODE, S_ISDIR from stat import S_IFREG, ST_UID, ST_GID, S_ISREG, S_IFDIR, S_ISLNK from sys import exc_info -from time import asctime, localtime +#from time import asctime, localtime from traceback import extract_tb from elementtree.ElementTree import Element, SubElement, tostring @@ -107,7 +107,7 @@ class Toolset(object): # Calculate number of total bundles and structures total = len(self.states) - stats.set('total',str(total)) + stats.set('total', str(total)) # Calculate number of good bundles and structures good = len([key for key, val in self.states.iteritems() if val]) stats.set('good', str(good)) @@ -126,12 +126,15 @@ class Toolset(object): # List bad elements of the configuration if dirty: bad_elms = SubElement(stats, "Bad") - for elm in [key for key,val in self.states.iteritems() if not val]: + 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 self.modified: + mod = SubElement(stats, "Modified") + for elm in self.modified: + SubElement(mod, elm.tag, elm.get('name')) return stats # the next two are dispatch functions -- cgit v1.2.3-1-g7c22