Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
etf
cmssam
Commits
ee69ac9f
Commit
ee69ac9f
authored
Mar 02, 2007
by
ericw
Browse files
Update to error handling
parent
92dde879
Changes
1
Hide whitespace changes
Inline
Side-by-side
SiteTests/FroNtier/tests/test_squid.py
View file @
ee69ac9f
...
...
@@ -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.
9
2007/03/02 1
6:53:51
ericw Exp $"
__revision__
=
"$Id: test_squid.py,v 1.
10
2007/03/02 1
7:01:35
ericw Exp $"
import
os
import
sys
import
urllib2
...
...
@@ -143,8 +143,8 @@ t1 = time.time()
#
try
:
result
=
urllib2
.
urlopen
(
request
).
read
()
except
urllib2
.
HTTPError
,
e
:
message1
=
e
.
msg
except
urllib2
.
HTTPError
,
e
1
:
message1
=
e
1
.
msg
if
site
!=
"CERN"
:
print
"test_squid.py: Error. squid "
+
squid
+
" is down, "
print
" unreachable or will not reply."
...
...
@@ -155,9 +155,9 @@ except urllib2.HTTPError, e:
print
" is down, unreachable or will not reply."
print
" urllib2.HTTPError: "
+
message1
sys
.
exit
(
same_error
)
except
urllib2
.
URLError
,
e
:
except
urllib2
.
URLError
,
e
2
:
print
"urllib2.URLError"
message2
=
e
.
reason
[
1
]
message2
=
e
2
.
reason
[
1
]
if
site
!=
"CERN"
:
print
"test_squid.py: Error. squid "
+
squid
+
" is down, "
print
" unreachable or will not reply."
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment