mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Get module version_added from existing, and catch invalid versions
This commit is contained in:
parent
3842ae9ded
commit
9b31175cf8
1 changed files with 8 additions and 2 deletions
|
@ -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])
|
||||
|
|
Loading…
Reference in a new issue