Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
mentors.debian.net
debexpo
Commits
1e3b2985
Verified
Commit
1e3b2985
authored
Mar 07, 2020
by
Baptiste Beauplat
Browse files
Catch timeout when tracker.d.o is not responding
parent
6326e2d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
debexpo/plugins/debianqa.py
View file @
1e3b2985
...
@@ -43,6 +43,7 @@ __license__ = 'MIT'
...
@@ -43,6 +43,7 @@ __license__ = 'MIT'
import
logging
import
logging
import
lxml.html
import
lxml.html
import
urllib2
import
urllib2
from
socket
import
timeout
from
debexpo.model
import
meta
from
debexpo.model
import
meta
from
debexpo.model.users
import
User
from
debexpo.model.users
import
User
...
@@ -60,7 +61,8 @@ class DebianPlugin(BasePlugin):
...
@@ -60,7 +61,8 @@ class DebianPlugin(BasePlugin):
try
:
try
:
self
.
qa_page
=
urllib2
.
urlopen
(
'https://tracker.debian.org/%s'
%
self
.
qa_page
=
urllib2
.
urlopen
(
'https://tracker.debian.org/%s'
%
self
.
changes
[
'Source'
])
self
.
changes
[
'Source'
])
except
urllib2
.
HTTPError
:
except
(
urllib2
.
HTTPError
,
timeout
)
as
e
:
log
.
error
(
'Failed to contact tracker: {}'
.
format
(
e
))
return
return
self
.
parsed_qa
=
lxml
.
html
.
fromstring
(
self
.
qa_page
.
read
())
self
.
parsed_qa
=
lxml
.
html
.
fromstring
(
self
.
qa_page
.
read
())
...
...
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