[Supervisor-checkins] r834 - superlance/trunk/superlance
Tres Seaver
tseaver at palladion.com
Wed Feb 11 14:12:26 EST 2009
Author: Tres Seaver <tseaver at palladion.com>
Date: Wed Feb 11 14:12:26 2009
New Revision: 834
Log:
Ensure that we keep telling parent we are OK, even if not eager and skipping check.
Modified:
superlance/trunk/superlance/httpok.py
Modified: superlance/trunk/superlance/httpok.py
==============================================================================
--- superlance/trunk/superlance/httpok.py (original)
+++ superlance/trunk/superlance/httpok.py Wed Feb 11 14:12:26 2009
@@ -172,32 +172,29 @@
act = False
- if not self.eager:
- specs = self.listProcesses(ProcessStates.RUNNING)
- if len(specs) == 0:
- if test:
- break
- continue
+ specs = self.listProcesses(ProcessStates.RUNNING)
+ if self.eager or len(specs) > 0:
- try:
- conn.request('GET', path)
- res = conn.getresponse()
- body = res.read()
- status = res.status
- msg = 'status contacting %s: %s %s' % (self.url,
- res.status, res.reason)
- except Exception, why:
- body = ''
- status = None
- msg = 'error contacting %s:\n\n %s' % (self.url, why)
-
- if str(status) != str(self.status):
- subject = 'httpok for %s: bad status returned' % self.url
- self.act(subject, msg)
- elif self.inbody and self.inbody not in res.body:
- act = True
- subject = 'httpok for %s: bad body returned' % self.url
- self.act(subject, msg)
+ try:
+ conn.request('GET', path)
+ res = conn.getresponse()
+ body = res.read()
+ status = res.status
+ msg = 'status contacting %s: %s %s' % (self.url,
+ res.status,
+ res.reason)
+ except Exception, why:
+ body = ''
+ status = None
+ msg = 'error contacting %s:\n\n %s' % (self.url, why)
+
+ if str(status) != str(self.status):
+ subject = 'httpok for %s: bad status returned' % self.url
+ self.act(subject, msg)
+ elif self.inbody and self.inbody not in res.body:
+ act = True
+ subject = 'httpok for %s: bad body returned' % self.url
+ self.act(subject, msg)
childutils.listener.ok(self.stdout)
if test:
More information about the Supervisor-checkins
mailing list