move deliverable type into deliverable files
The deliverable type is really only used to control how the releases.openstack.org website is rendered, so it does not need to be in the governance repository. Copy the current values here to a new 'type' field in the deliverable file and update the validator to require all deliverable files to have values. Change-Id: I0def1117b45170ebf451ef510917db9c20301e17 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
@@ -47,6 +47,12 @@ _VALID_MODELS = set([
|
||||
'cycle-trailing',
|
||||
'independent',
|
||||
])
|
||||
_VALID_TYPES = set([
|
||||
'horizon-plugin',
|
||||
'library',
|
||||
'service',
|
||||
'other',
|
||||
])
|
||||
|
||||
|
||||
def is_a_hash(val):
|
||||
@@ -184,6 +190,19 @@ def main():
|
||||
(release_model, filename, sorted(list(_VALID_MODELS)))
|
||||
)
|
||||
|
||||
# Determine the deliverable type. Require an explicit value.
|
||||
deliverable_type = deliverable_info.get('type')
|
||||
if not deliverable_type:
|
||||
errors.append(
|
||||
'No deliverable type for %s, must be one of %r' %
|
||||
(filename, sorted(list(_VALID_TYPES)))
|
||||
)
|
||||
elif deliverable_type not in _VALID_TYPES:
|
||||
errors.append(
|
||||
'Invalid deliverable type %r for %s, must be one of %r' %
|
||||
(deliverable_type, filename, sorted(list(_VALID_TYPES)))
|
||||
)
|
||||
|
||||
# Remember which entries are new so we can verify that they
|
||||
# appear at the end of the file.
|
||||
new_releases = {}
|
||||
|
||||
@@ -84,7 +84,7 @@ class Deliverable(object):
|
||||
for t in self.tags:
|
||||
if t.startswith('type:'):
|
||||
return t.partition(':')[-1]
|
||||
return 'unknown'
|
||||
return 'other'
|
||||
|
||||
@property
|
||||
def model(self):
|
||||
|
||||
Reference in New Issue
Block a user