diff --git a/openstack_releases/cmds/validate.py b/openstack_releases/cmds/validate.py index 384a3d0fa7..e57abece0e 100644 --- a/openstack_releases/cmds/validate.py +++ b/openstack_releases/cmds/validate.py @@ -879,13 +879,13 @@ def validate_new_releases_at_end(deliv, context): def validate_new_releases_in_open_series(deliv, context): "New releases may only be added to open series." - if deliv.series_info.allows_releases: - print('{} has status {!r} and allows releases'.format( - deliv.series, deliv.series_info.status)) + if deliv.allows_releases: + print('{} has status {!r} for {} and allows releases'.format( + deliv.name, deliv.series, deliv.stable_status)) return - LOG.debug('%s has status %r and will not allow releases', - deliv.series, deliv.series_info.status) + LOG.debug('%s has status %r for %s and will not allow new releases', + deliv.name, deliv.stable_status, deliv.series) # Remember which entries are new so we can verify that they # appear at the end of the file. @@ -912,9 +912,9 @@ def validate_new_releases_in_open_series(deliv, context): if new_releases: # The series is closed but there is a new release. - msg = ('series {} has status {!r} ' + msg = ('deliverable {} has status {!r} for {}' 'and cannot have new releases tagged').format( - deliv.series, deliv.series_info.status) + deliv.name, deliv.stable_status, deliv.series) context.error(msg) else: print('OK') diff --git a/openstack_releases/deliverable.py b/openstack_releases/deliverable.py index 4431b18dc6..c34a9cfdf0 100644 --- a/openstack_releases/deliverable.py +++ b/openstack_releases/deliverable.py @@ -547,6 +547,10 @@ class Deliverable(object): status = self.series_info.status return status + @property + def allows_releases(self): + return self.stable_status in ('development', 'maintained') + def __eq__(self, other): return self.name == other.name diff --git a/openstack_releases/series_status.py b/openstack_releases/series_status.py index 70a3774876..c2a0e84b1a 100644 --- a/openstack_releases/series_status.py +++ b/openstack_releases/series_status.py @@ -47,10 +47,6 @@ class Series(object): def eol_date(self): return self._data.get('eol-date', None) - @property - def allows_releases(self): - return self.status in ('development', 'maintained') - class SeriesStatus(collections.abc.Mapping):