Don't crash on unversioned unblock hints.

bzr-import-20160707
Colin Watson 12 years ago
parent 1c1d8cf891
commit 9da36a9385

@ -1434,13 +1434,17 @@ class Britney(object):
unblock_cmd = "un" + block_cmd
unblocks = self.hints.search(unblock_cmd, package=src)
if unblocks and self.same_source(unblocks[0].version, source_u[VERSION]):
if unblocks and unblocks[0].version is not None and self.same_source(unblocks[0].version, source_u[VERSION]):
excuse.addhtml("Ignoring %s request by %s, due to %s request by %s" %
(block_cmd, blocked[block_cmd].user, unblock_cmd, unblocks[0].user))
else:
if unblocks:
excuse.addhtml("%s request by %s ignored due to version mismatch: %s" %
(unblock_cmd.capitalize(), unblocks[0].user, unblocks[0].version))
if unblocks[0].version is None:
excuse.addhtml("%s request by %s ignored due to missing version" %
(unblock_cmd.capitalize(), unblocks[0].user))
else:
excuse.addhtml("%s request by %s ignored due to version mismatch: %s" %
(unblock_cmd.capitalize(), unblocks[0].user, unblocks[0].version))
excuse.addhtml("Not touching package due to %s request by %s (contact #ubuntu-release if update is needed)" %
(block_cmd, blocked[block_cmd].user))
update_candidate = False

Loading…
Cancel
Save