Also blacklist with Node-related problems (besides App-related ones)
authorClaudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Mon, 3 Oct 2011 01:11:19 +0000 (03:11 +0200)
committerClaudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Mon, 3 Oct 2011 01:11:19 +0000 (03:11 +0200)
src/nepi/testbeds/planetlab/node.py

index 6c11f44..1d4d5ca 100644 (file)
@@ -15,6 +15,7 @@ import sys
 import logging
 import ipaddr
 import operator
+import re
 
 from nepi.util import server
 from nepi.util import parallel
@@ -466,6 +467,8 @@ class Node(object):
                     )
                 
                 if proc.wait():
+                    if self.check_bad_host(out,err):
+                        self.blacklist()
                     raise RuntimeError, "Failed to set up application: %s %s" % (out,err,)
             
             # Launch p2p yum dependency installer
@@ -753,3 +756,10 @@ class Node(object):
         elif out or err:
             logger.debug("%s said: %s%s", method, out, err)
 
+    def check_bad_host(self, out, err):
+        badre = re.compile(r'(?:'
+                           r"curl: [(]\d+[)] Couldn't resolve host 'download1[.]rpmfusion[.]org'"
+                           r'|Error: disk I/O error'
+                           r')', 
+                           re.I)
+        return badre.search(out) or badre.search(err)