mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Get module version_added from existing, and catch invalid versions
This commit is contained in:
@@ -423,8 +423,6 @@ class ModuleValidator(Validator):
|
||||
if self._is_new_module():
|
||||
return
|
||||
|
||||
mod_version_added = StrictVersion(str(doc.get('version_added', '0.0')))
|
||||
|
||||
with CaptureStd():
|
||||
try:
|
||||
existing = module_loader.find_plugin(self.name, mod_type='.py')
|
||||
@@ -441,6 +439,14 @@ class ModuleValidator(Validator):
|
||||
'TRACE')
|
||||
return
|
||||
|
||||
|
||||
try:
|
||||
mod_version_added = StrictVersion(
|
||||
str(existing_doc.get('version_added', '0.0'))
|
||||
)
|
||||
except ValueError:
|
||||
mod_version_added = StrictVersion('0.0')
|
||||
|
||||
options = doc.get('options', {})
|
||||
|
||||
should_be = '.'.join(ansible_version.split('.')[:2])
|
||||
|
||||
Reference in New Issue
Block a user