default deliverable type to other in sort

The validation job now requires type to be set, but we have several old
deliverables without it. Rather than edit all of them, set the default
to 'other' to avoid comparing None with a string.

Change-Id: I4e5a1d5f19dac8f6253bc7d6d040e1869c004d08
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2017-03-03 15:40:35 -05:00
parent ae41fe8b7a
commit 011c65b55a

View File

@ -60,7 +60,7 @@ def _get_category(data):
model = data.get('release-model')
if model == 'cycle-trailing':
return 'cycle-trailing'
return data.get('type')
return data.get('type', 'other')
_deliverables = None
@ -126,14 +126,13 @@ class DeliverableDirectiveBase(rst.Directive):
# Only the deliverables for the given series are
# shown. They are categorized by type, which we need to
# extract from the data.
raw_deliverables = (
raw_deliverables = [
(_get_category(_data), _deliv_name, _data)
for _team, _series, _deliv_name, _data in _deliverables.get_deliverables(
self.team_name,
series,
)
)
raw_deliverables = list(raw_deliverables)
]
grouped = itertools.groupby(
sorted(raw_deliverables),
key=operator.itemgetter(0), # the category