1
0
Fork 0
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:
Matt Martz 2016-02-22 11:11:06 -06:00 committed by John Barker
parent 3842ae9ded
commit 9b31175cf8

View file

@ -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])