diff --git a/test/sanity/validate-modules/main.py b/test/sanity/validate-modules/main.py index 4f800e50e6..32f34fedb0 100755 --- a/test/sanity/validate-modules/main.py +++ b/test/sanity/validate-modules/main.py @@ -1374,10 +1374,14 @@ class ModuleValidator(Validator): # See if current version => deprecated.removed_in, ie, should be docs only if docs and 'deprecated' in docs and docs['deprecated'] is not None: - removed_in = docs.get('deprecated')['removed_in'] - strict_ansible_version = StrictVersion('.'.join(ansible_version.split('.')[:2])) - end_of_deprecation_should_be_docs_only = strict_ansible_version >= removed_in - # FIXME if +2 then file should be empty? - maybe add this only in the future + try: + removed_in = StrictVersion(str(docs.get('deprecated')['removed_in'])) + except ValueError: + end_of_deprecation_should_be_docs_only = False + else: + strict_ansible_version = StrictVersion('.'.join(ansible_version.split('.')[:2])) + end_of_deprecation_should_be_docs_only = strict_ansible_version >= removed_in + # FIXME if +2 then file should be empty? - maybe add this only in the future if self._python_module() and not self._just_docs() and not end_of_deprecation_should_be_docs_only: self._validate_ansible_module_call(docs)