From 23bb8265eab359f57023d20a736d58ce68b1ab04 Mon Sep 17 00:00:00 2001 From: Brandon King Date: Sat, 10 Nov 2007 01:27:44 +0000 Subject: [PATCH] [project @ Finished statement + additional error message] * 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/retrieve_eland_config.py b/bin/retrieve_eland_config.py index 7cb116b..3b337b0 100644 --- a/bin/retrieve_eland_config.py +++ b/bin/retrieve_eland_config.py @@ -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 -- 2.30.2