mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
ovirt_vm: Fix issue in setting the custom_compatibility_version to NULL
Currently there is no way to reset the custom_compatibility_version to
NULL. If we provide a empty string('') to custom_compatibility_version,
it will fail with error "IndexError: list index out of range" at _get_minor
function.
To reset the custom_compatibility_version, we have to pass None value to
types.Version. The PR fixes the same.
This commit is contained in:
committed by
Toshio Kuratomi
parent
a0f58fa2ef
commit
bc741eb2a0
@@ -790,14 +790,14 @@ class BaseModule(object):
|
||||
return entity
|
||||
|
||||
def _get_major(self, full_version):
|
||||
if full_version is None:
|
||||
if full_version is None or full_version == "":
|
||||
return None
|
||||
if isinstance(full_version, otypes.Version):
|
||||
return int(full_version.major)
|
||||
return int(full_version.split('.')[0])
|
||||
|
||||
def _get_minor(self, full_version):
|
||||
if full_version is None:
|
||||
if full_version is None or full_version == "":
|
||||
return None
|
||||
if isinstance(full_version, otypes.Version):
|
||||
return int(full_version.minor)
|
||||
|
||||
Reference in New Issue
Block a user