1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Only check version correctness on new modules. Fixes #11

This commit is contained in:
Matt Martz 2015-12-22 10:48:36 -06:00 committed by John Barker
parent 1d2cb3968f
commit 61a49e0420

View file

@ -16,6 +16,7 @@ from distutils.version import StrictVersion
from utils import find_globals
from ansible.plugins import module_loader
from ansible.executor.module_common import REPLACER_WINDOWS
from ansible.utils.module_docs import get_docstring, BLACKLIST_MODULES
@ -157,6 +158,9 @@ class ModuleValidator(Validator):
def _is_bottom_import_blacklisted(self):
return self.object_name in self.BOTTOM_IMPORTS_BLACKLIST
def _is_new_module(self):
return not module_loader.has_plugin(self.name)
def _check_interpreter(self, powershell=False):
if powershell:
if not self.text.startswith('#!powershell\n'):
@ -318,6 +322,9 @@ class ModuleValidator(Validator):
'function: %s' % ', '.join(redeclared))
def _check_version_added(self, doc):
if not self._is_new_module():
return
try:
version_added = StrictVersion(doc.get('version_added', '0.0'))
except ValueError: