mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-12 15:41:09 +00:00
pull-lp-source: Catch errors parsing JSON we got from DDE (LP: #1059848)
This commit is contained in:
parent
73461fca08
commit
586197d591
1
debian/changelog
vendored
1
debian/changelog
vendored
@ -19,6 +19,7 @@ ubuntu-dev-tools (0.144) UNRELEASED; urgency=low
|
||||
(LP: #936014)
|
||||
* ubuntutools.question: Catch EOF and SIGINT on all input and bail out.
|
||||
(LP: #1037488)
|
||||
* pull-lp-source: Catch errors parsing JSON we got from DDE (LP: #1059848)
|
||||
|
||||
[ Benjamin Drung ]
|
||||
* seeded-in-ubuntu: State in error message that it takes a source package.
|
||||
|
@ -47,12 +47,14 @@ def source_package_for(binary, release):
|
||||
"""
|
||||
url = ('http://dde.debian.net/dde/q/udd/dist/d:ubuntu/r:%s/p:%s/?t=json'
|
||||
% (release, binary))
|
||||
data = None
|
||||
try:
|
||||
data = json.load(urllib2.urlopen(url))['r']
|
||||
except urllib2.URLError, e:
|
||||
Logger.error('Unable to retrieve package information from DDE: '
|
||||
'%s (%s)', url, str(e))
|
||||
return None
|
||||
except ValueError:
|
||||
Logger.error('Unable to parse the response from DDE.')
|
||||
if not data:
|
||||
return None
|
||||
return data[0]['source']
|
||||
|
Loading…
x
Reference in New Issue
Block a user