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)

* 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:
wh1t3 r4bb1t 2022-11-09 00:00:05 +02:00 committed by GitHub
parent 27827cbea4
commit 621fb6a619
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': 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