Skip to content

Commit dab49df

Browse files
author
Carlos Konstanski
committed
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
1 parent b061b9c commit dab49df

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

openstackclient/network/v2/_tag.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ def update_tags_for_set(client, obj, parsed_args):
102102
if parsed_args.no_tag:
103103
tags = set()
104104
else:
105-
tags = set(obj.tags)
105+
tags = set(obj.tags or [])
106106
if parsed_args.tags:
107107
tags |= set(parsed_args.tags)
108-
if set(obj.tags) != tags:
108+
if set(obj.tags or []) != tags:
109109
client.set_tags(obj, list(tags))
110110

111111

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
fixes:
3+
- |
4+
``openstack subnet create`` failed with a NoneType exception when
5+
there were no tags.
6+
[Bug `1735836 <https://bugs.launchpad.net/python-openstackclient/+bug/1735836>`_]

0 commit comments

Comments
 (0)