From 011c65b55a8208bb8f5bbd8ac506bba7f79a3eb3 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Fri, 3 Mar 2017 15:40:35 -0500 Subject: [PATCH] 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 --- openstack_releases/sphinxext.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openstack_releases/sphinxext.py b/openstack_releases/sphinxext.py index bcca9493b4..115d86a315 100644 --- a/openstack_releases/sphinxext.py +++ b/openstack_releases/sphinxext.py @@ -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