From dab49df461d7ca68001632f11dc5bf1229271de9 Mon Sep 17 00:00:00 2001 From: Carlos Konstanski Date: Fri, 1 Dec 2017 14:58:52 -0700 Subject: [PATCH] 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 --- openstackclient/network/v2/_tag.py | 4 ++-- releasenotes/notes/bug-1735836-9be6d777a6e6410b.yaml | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/bug-1735836-9be6d777a6e6410b.yaml diff --git a/openstackclient/network/v2/_tag.py b/openstackclient/network/v2/_tag.py index d1e59937fa..ce39f35ec0 100644 --- a/openstackclient/network/v2/_tag.py +++ b/openstackclient/network/v2/_tag.py @@ -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)) diff --git a/releasenotes/notes/bug-1735836-9be6d777a6e6410b.yaml b/releasenotes/notes/bug-1735836-9be6d777a6e6410b.yaml new file mode 100644 index 0000000000..346048532d --- /dev/null +++ b/releasenotes/notes/bug-1735836-9be6d777a6e6410b.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + ``openstack subnet create`` failed with a NoneType exception when + there were no tags. + [Bug `1735836 `_]