mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
one_vm: fix for 'NoneType' object has no attribute 'split' in get_vm_labels_and_attributes_dict (#5489)
* Fix for 'NoneType' object has no attribute 'split' * Added changelog to fix * Update changelogs/fragments/5489-nonetype-in-get-vm-by-label.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Fix line ending in changelog Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
27827cbea4
commit
621fb6a619
2 changed files with 3 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- one_vm - avoid splitting labels that are ``None`` (https://github.com/ansible-collections/community.general/pull/5489).
|
|
@ -970,7 +970,7 @@ def get_vm_labels_and_attributes_dict(client, vm_id):
|
||||||
if key != 'LABELS':
|
if key != 'LABELS':
|
||||||
attrs_dict[key] = value
|
attrs_dict[key] = value
|
||||||
else:
|
else:
|
||||||
if key is not None:
|
if key is not None and value is not None:
|
||||||
labels_list = value.split(',')
|
labels_list = value.split(',')
|
||||||
|
|
||||||
return labels_list, attrs_dict
|
return labels_list, attrs_dict
|
||||||
|
|
Loading…
Reference in a new issue