Commit e77ff024 authored by ericw's avatar ericw
Browse files

Print error message from urllib2.URLError

parent 2e1b3343
......@@ -10,7 +10,7 @@ Tests the local FroNtier squid
# 3) file $CMS_PATH/SITECONF/local/JobConfig/site-local-config.xml
# contains the location of the local FroNtier squid server
#
__revision__ = "$Id: test_squid.py,v 1.6 2007/02/26 17:19:25 ericw Exp $"
__revision__ = "$Id: test_squid.py,v 1.7 2007/03/01 16:07:53 ericw Exp $"
import os
import sys
import urllib2
......@@ -25,7 +25,6 @@ import time
#
print "node " + os.uname()[1]
#
#
# Check that environmental variable SAME_OK is set
#
if not os.environ.has_key("SAME_OK"):
......@@ -144,14 +143,18 @@ t1 = time.time()
#
try:
result = urllib2.urlopen(request).read()
except urllib2.URLError:
except urllib2.URLError, e:
rc, message = e.reason
if site != "CERN":
print "test_squid.py: Error. squid " + squid + \
" is down or unreachable"
print "test_squid.py: Error. squid " + squid + " is down, "
print " unreachable or will not reply."
print " " + message
sys.exit(same_error)
else:
print "test_squid.py: Error. FroNtier server " + frontierUrl + \
" is down or unreachable"
" is down, "
print " unreachable or will not reply."
print " " + message
sys.exit(same_error)
except:
print "test_squid.py: Error."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment