From a502045d3641244fbc6e990701fdde52e22c0630 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Thu, 11 Dec 2008 21:36:24 +0000 Subject: 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 --- src/lib/Client/Tools/__init__.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/lib/Client') 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'))) -- cgit v1.2.3-1-g7c22