Commits

Tres Seaver committed 0c7948f

[svn r834] Ensure that we keep telling parent we are OK, even if not eager and skipping check.

Comments (0)

Files changed (1)

trunk/superlance/httpok.py

 
             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)
+                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)
+                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:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.