Skip to content

Commit

Permalink
one_vm: fix for 'NoneType' object has no attribute 'split' in get_vm_…
Browse files Browse the repository at this point in the history
…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 <[email protected]>

* Fix line ending in changelog

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 621fb6a)

Co-authored-by: wh1t3 r4bb1t <[email protected]>
  • Loading branch information
patchback[bot] and d34d5p4rr0w authored Nov 9, 2022
1 parent 64897d7 commit d817fc7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/5489-nonetype-in-get-vm-by-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- one_vm - avoid splitting labels that are ``None`` (https://github.com/ansible-collections/community.general/pull/5489).
2 changes: 1 addition & 1 deletion plugins/modules/cloud/opennebula/one_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d817fc7

Please sign in to comment.