Don't let Python abort unconditionally if a host wasn't found.
authorjoey <>
Sun, 2 Jul 2006 03:10:25 +0000 (03:10 +0000)
committerjoey <>
Sun, 2 Jul 2006 03:10:25 +0000 (03:10 +0000)
ud-generate

index 971fec2..ba282b9 100755 (executable)
@@ -544,8 +544,11 @@ def GenHosts(l,File):
       if x[1].has_key("hostname") == 0:
          continue;
       Host = GetAttr(x,"hostname");
-      Addr = socket.gethostbyname(Host);
-      F.write(Addr + "\n");
+      try:
+        Addr = socket.gethostbyname(Host);
+        F.write(Addr + "\n");
+      except:
+        pass
   # Oops, something unspeakable happened.
   except:
    Die(File,F,None);