mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-06-19 21:51:30 +00:00
Excuse: get source from MigrationItem
This commit is contained in:
parent
055f0f07e5
commit
5c7300caf0
@ -195,6 +195,10 @@ class Excuse(object):
|
|||||||
def name(self):
|
def name(self):
|
||||||
return self.item.name
|
return self.item.name
|
||||||
|
|
||||||
|
@property
|
||||||
|
def source(self):
|
||||||
|
return self.item.package
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_valid(self):
|
def is_valid(self):
|
||||||
return False if self._policy_verdict.is_rejected else True
|
return False if self._policy_verdict.is_rejected else True
|
||||||
@ -433,17 +437,10 @@ class Excuse(object):
|
|||||||
|
|
||||||
def excusedata(self):
|
def excusedata(self):
|
||||||
"""Render the excuse in as key-value data"""
|
"""Render the excuse in as key-value data"""
|
||||||
source = self.name
|
|
||||||
if '_' in source:
|
|
||||||
source = source.split("_")[0]
|
|
||||||
if '/' in source:
|
|
||||||
source = source.split("/")[0]
|
|
||||||
if source[0] == '-':
|
|
||||||
source = source[1:]
|
|
||||||
excusedata = {}
|
excusedata = {}
|
||||||
excusedata["excuses"] = self._text()
|
excusedata["excuses"] = self._text()
|
||||||
excusedata["item-name"] = self.name
|
excusedata["item-name"] = self.name
|
||||||
excusedata["source"] = source
|
excusedata["source"] = self.source
|
||||||
excusedata["migration-policy-verdict"] = self._policy_verdict.name
|
excusedata["migration-policy-verdict"] = self._policy_verdict.name
|
||||||
excusedata["old-version"] = self.ver[0]
|
excusedata["old-version"] = self.ver[0]
|
||||||
excusedata["new-version"] = self.ver[1]
|
excusedata["new-version"] = self.ver[1]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user