ubuntutools.archive: Improve error handling around rmadison calls

(LP: #1010951)
This commit is contained in:
Stefano Rivera 2012-06-20 22:32:20 +02:00
parent fa83ac6b0b
commit 4056e98a43
2 changed files with 6 additions and 5 deletions

2
debian/changelog vendored
View File

@ -26,6 +26,8 @@ ubuntu-dev-tools (0.143) UNRELEASED; urgency=low
* backportpackage.1: Document --key and --dont-sign (LP: #1007564)
* seeded-in-ubuntu: Catch errors in parsing data, and don't keep unreadable
data cached (LP: #1008783)
* ubuntutools.archive: Improve error handling around rmadison calls
(LP: #1010951)
-- Mathieu Trudel-Lapierre <mathieu-tl@ubuntu.com> Wed, 06 Jun 2012 09:53:24 -0400

View File

@ -600,13 +600,12 @@ def rmadison(url, package, suite=None, arch=None):
process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, close_fds=True)
output, error_output = process.communicate()
try:
assert process.wait() == 0
except AssertionError:
if process.wait() != 0:
if error_output:
Logger.error('rmadison failed with: %s', error_output)
sys.exit(1)
raise
else:
Logger.error('rmadison failed')
sys.exit(1)
# rmadison uses some shorthand
if suite: