diff options
author | Sol Jerome <solj@ices.utexas.edu> | 2008-12-11 21:36:24 +0000 |
---|---|---|
committer | Sol Jerome <solj@ices.utexas.edu> | 2008-12-11 21:36:24 +0000 |
commit | a502045d3641244fbc6e990701fdde52e22c0630 (patch) | |
tree | 249a83c9bc51be6db4499f81f365c9d095ec79bf /src | |
parent | 5d4d6152298f85ae36e775351a26a0bd9bdd52b3 (diff) | |
download | bcfg2-a502045d3641244fbc6e990701fdde52e22c0630.tar.gz bcfg2-a502045d3641244fbc6e990701fdde52e22c0630.tar.bz2 bcfg2-a502045d3641244fbc6e990701fdde52e22c0630.zip |
Do not stop services in build mode (Partially resolves Ticket #624)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4993 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Client/Tools/__init__.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/Client/Tools/__init__.py b/src/lib/Client/Tools/__init__.py index 22aeb664b..a827e7924 100644 --- a/src/lib/Client/Tools/__init__.py +++ b/src/lib/Client/Tools/__init__.py @@ -139,7 +139,9 @@ class Tool: def getSupportedEntries(self): '''return a list of supported entries''' - return [entry for struct in self.config.getchildren() for entry in struct.getchildren() \ + return [entry for struct in \ + self.config.getchildren() for entry in \ + struct.getchildren() \ if self.handlesEntry(entry)] def handlesEntry(self, entry): @@ -284,12 +286,15 @@ class SvcTool(Tool): '''The Bundle has been updated''' for entry in bundle: if self.handlesEntry(entry): + rc = 0 if entry.get('status') == 'on' and not self.setup['build']: self.logger.debug('Restarting service %s' % entry.get('name')) rc = self.cmd.run('/etc/init.d/%s %s' % \ (entry.get('name'), entry.get('reload', self.__svcrestart__)))[0] - else: + elif not self.setup['build']: self.logger.debug('Stopping service %s' % entry.get('name')) - rc = self.cmd.run('/etc/init.d/%s stop' % (entry.get('name')))[0] + rc = self.cmd.run('/etc/init.d/%s stop' % \ + (entry.get('name')))[0] if rc: - self.logger.error("Failed to restart service %s" % (entry.get('name'))) + self.logger.error("Failed to restart service %s" % \ + (entry.get('name'))) |