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) (#5513)
* 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>
(cherry picked from commit 621fb6a619
)
Co-authored-by: wh1t3 r4bb1t <16529603+d34d5p4rr0w@users.noreply.github.com>
This commit is contained in:
parent
081b4068a0
commit
c6d0419460
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':
|
||||
attrs_dict[key] = value
|
||||
else:
|
||||
if key is not None:
|
||||
if key is not None and value is not None:
|
||||
labels_list = value.split(',')
|
||||
|
||||
return labels_list, attrs_dict
|
||||
|
|
Loading…
Reference in a new issue