[project @ Finished statement + additional error message]
authorBrandon King <kingb@caltech.edu>
Sat, 10 Nov 2007 01:27:44 +0000 (01:27 +0000)
committerBrandon King <kingb@caltech.edu>
Sat, 10 Nov 2007 01:27:44 +0000 (01:27 +0000)
 * Now says where it wrote the config file to upon success
 * Now puts more meaningful error message when user enters invalid domain/ip address.

bin/retrieve_eland_config.py

index 7cb116bb66d7be5f5d104f1b774d9b7000e6db73..3b337b058926d3c3f4bfbf4aa95bb070c4a745d9 100644 (file)
@@ -113,15 +113,20 @@ def saveConfigFile(flowcell, base_host_url, output_filepath):
     web = urllib.urlopen(url)
   except IOError, msg:
     if str(msg).find("Connection refused") >= 0:
-      print 'Error: Could not connect to: %s' % (url)
+      print 'Error: Connection refused for: %s' % (url)
       f.close()
       sys.exit(1)
+    elif str(msg).find("Name or service not known") >= 0:
+      print 'Error: Invalid domain or ip address for: %s' % (url)
+      f.close()
+      sys.exit(2)
     else:
       raise IOError, msg
     
   f.write(web.read())
   web.close()
   f.close()
+  print 'Wrote config file to %s' % (output_filepath)
 
 if __name__ == '__main__':
   #Display help if no args are presented