diff --git a/ansible_testing/modules.py b/ansible_testing/modules.py index 086c5f5bd0..721d4e1364 100644 --- a/ansible_testing/modules.py +++ b/ansible_testing/modules.py @@ -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])