Ignore empty sections in notes

Users may do this, and it doesn't make sense to explode when a valid
section is stated but empty.

Change-Id: I1b30be6122893563cdc4c41172e28ed5a69a0e3c
Closes-Bug: #1588992
This commit is contained in:
Clint Byrum 2016-06-03 15:14:26 -07:00
parent 38b015817e
commit 45878e06b2
2 changed files with 2 additions and 0 deletions

View File

@ -68,6 +68,7 @@ def format_report(loader, versions_to_include, title=None):
notes = [
n
for fn, sha in notefiles
if file_contents[fn].get(section_name)
for n in file_contents[fn].get(section_name, [])
]
if notes:

View File

@ -42,6 +42,7 @@ class TestFormatter(base.TestCase):
'features': [
'We added a feature!',
],
'upgrade': None,
},
}