diff options
-rw-r--r-- | src/lib/Client/Toolset.py | 25 | ||||
-rw-r--r-- | src/lib/Server/Core.py | 2 |
2 files changed, 4 insertions, 23 deletions
diff --git a/src/lib/Client/Toolset.py b/src/lib/Client/Toolset.py index 5341d3c84..2c0bd693a 100644 --- a/src/lib/Client/Toolset.py +++ b/src/lib/Client/Toolset.py @@ -5,7 +5,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 -import binascii, copy, grp, logging, lxml.etree, os, popen2, pwd, stat, sys, ConfigParser, cStringIO +import binascii, copy, grp, logging, lxml.etree, os, popen2, pwd, stat, sys def calcPerms(initial, perms): '''This compares ondisk permissions with specified ones''' @@ -63,26 +63,6 @@ class Toolset(object): if not self.states[cfile]: self.InstallConfigFile(cfile) self.statistics = lxml.etree.Element("Statistics") - # handle $Revision string processing here - cfp = ConfigParser.ConfigParser() - cfp.read('/etc/bcfg2.conf') - initial = '' - try: - initial = cfp.get('Specification', 'Revision') - except ConfigParser.NoOptionError: - pass - self.statistics.set('initial', initial) - goal = '' - upstream = [cfl for cfl in cfg.findall(".//ConfigFile") if cfg.get('name') == '/etc/bcfg2.conf'] - if upstream: - cfp = ConfigParser.ConfigParser() - cfp.readfp(cStringIO.StringIO(upstream[0].text)) - try: - goal = cfp.get('Specification', 'Revision') - except ConfigParser.NoOptionError: - pass - if goal != initial: - self.logger.info("Specification revision: %s should be upgraded to %s" % (initial, goal)) def saferun(self, command): '''Run a command in a pipe dealing with stdout buffer overloads''' @@ -180,7 +160,7 @@ class Toolset(object): def GenerateStats(self, client_version): '''Generate XML summary of execution statistics''' - stats = lxml.etree.Element("Statistics") + stats = self.statistics # Calculate number of total bundles and structures total = len(self.states) @@ -190,6 +170,7 @@ class Toolset(object): stats.set('good', str(good)) stats.set('version', '2.0') stats.set('client_version', client_version) + stats.set('revision', self.cfg.get('revision')) if len([key for key, val in self.states.iteritems() if not val]) == 0: stats.set('state', 'clean') diff --git a/src/lib/Server/Core.py b/src/lib/Server/Core.py index 0841d0c6f..7b12e2d26 100644 --- a/src/lib/Server/Core.py +++ b/src/lib/Server/Core.py @@ -279,7 +279,7 @@ class Core(object): def BuildConfiguration(self, client): '''Build Configuration for client''' start = time() - config = lxml.etree.Element("Configuration", version='2.0') + config = lxml.etree.Element("Configuration", version='2.0', revision=self.revision) try: meta = self.metadata.get_metadata(client) except Bcfg2.Server.Metadata.MetadataConsistencyError: |