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

Change-Id: Ife608108c22c38fe9913a5ed6095d643832cbd12
This commit is contained in:
Ihar Hrachyshka 2017-06-13 14:54:22 -07:00
parent ffe14d7ed9
commit d15e2b8901
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__':