1
0
Fork 0
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) (#5512)

* 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:
patchback[bot] 2022-11-09 07:12:05 +01:00 committed by GitHub
parent 64897d762c
commit d817fc7215
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- one_vm - avoid splitting labels that are ``None`` (https://github.com/ansible-collections/community.general/pull/5489).

View file

@ -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