Fix case where no comments specified

This commit is contained in:
Erik Johnson 2018-03-14 11:22:15 -05:00
parent ce391c53f4
commit b70c3389da
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -2663,9 +2663,9 @@ def mod_repo(repo, basedir=None, **kwargs):
filerepos[repo].update(repo_opts)
content = header
for stanza in six.iterkeys(filerepos):
comments = filerepos[stanza].pop('comments', [])
if comments:
comments = salt.utils.pkg.rpm.combine_comments(comments)
comments = salt.utils.pkg.rpm.combine_comments(
filerepos[stanza].pop('comments', [])
)
content += '[{0}]\n'.format(stanza)
for line in six.iterkeys(filerepos[stanza]):
content += '{0}={1}\n'.format(