Closed fabianvf closed 7 years ago
Thanks @fabianvf. To the current maintainers, @machacekondra please review according to guidelines (http://docs.ansible.com/ansible/developing_modules.html#module-checklist) and comment with text 'shipit', 'needs_revision' or 'close_me' as appropriate.
[This message brought to you by your friendly Ansibull-bot.]
Thank you Fabian. shipit
Just FYI, it's not possible to create disk name with empty string, and if user will send 0, it will be actually '0', but indeed better to be save. Thanks.
Thanks again to @fabianvf for this PR, and thanks @machacekondra for reviewing. Marking for inclusion.
[This message brought to you by your friendly Ansibull-bot.]
I would welcome backport to 2.2, if there will be another 2.2 release.
backported to 2.2 for 2.2.1
ISSUE TYPE
COMPONENT NAME
ovirt_disks
ANSIBLE VERSION
SUMMARY
I wanted to create disks that were unattached from a VM, so I used a configuration like this:
but this threw an error saying that the VM could not be found. I looked into the code and noticed that the check for whether or not vm information was provided was this:
which would only check the keys of
module.params
, which will always havevm_id
andvm_name
in it. Simplified example of the issue below:I replaced the
'vm_id' in module.params
withmodule.params.get('vm_id') is not None
, which should beFalse
when vm_id is not provided by the user. I usedis not None
rather than relying on python false-iness because I wasn't sure if disk names like0
or empty string should count as the user not providing them.Before:
After: