Merge "lp-tag.py: be prepared for empty lines in input"

This commit is contained in:
Jenkins 2017-06-19 09:05:09 +00:00 committed by Gerrit Code Review
commit dc67767783
1 changed files with 8 additions and 7 deletions

View File

@ -35,13 +35,14 @@ def main():
lp = Launchpad.login_with('openstack-releasing', 'production')
bugnums = [line.strip() for line in sys.stdin.readlines()]
for bugnum in bugnums:
bug = lp.bugs[bugnum]
tag = args.tag
tags = bug.tags
if tag not in tags:
tags.append(tag)
bug.tags = tags
bug.lp_save()
if bugnum:
bug = lp.bugs[bugnum]
tag = args.tag
tags = bug.tags
if tag not in tags:
tags.append(tag)
bug.tags = tags
bug.lp_save()
if __name__ == '__main__':