openstack subnet create fails when tags is None

In network/v2/_tag.py lines 105 and 110: obj.tags can be None, in
which case set(obj.tags) throws a NoneType exception.

Change-Id: I1e965ec947844cbf84676fab27a2261fc0c0ea49
Closes-Bug: #1735836
This commit is contained in:
Carlos Konstanski 2017-12-01 14:58:52 -07:00
parent b061b9c34e
commit dab49df461
2 changed files with 8 additions and 2 deletions

View File

@ -102,10 +102,10 @@ def update_tags_for_set(client, obj, parsed_args):
if parsed_args.no_tag:
tags = set()
else:
tags = set(obj.tags)
tags = set(obj.tags or [])
if parsed_args.tags:
tags |= set(parsed_args.tags)
if set(obj.tags) != tags:
if set(obj.tags or []) != tags:
client.set_tags(obj, list(tags))

View File

@ -0,0 +1,6 @@
---
fixes:
- |
``openstack subnet create`` failed with a NoneType exception when
there were no tags.
[Bug `1735836 <https://bugs.launchpad.net/python-openstackclient/+bug/1735836>`_]