Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validate-modules improve empty version_added handling #53177

Merged
merged 2 commits into from
Mar 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion test/sanity/validate-modules/ignore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ lib/ansible/modules/cloud/google/gcpubsub_facts.py E322
lib/ansible/modules/cloud/google/gcpubsub_facts.py E324
lib/ansible/modules/cloud/google/gcpubsub_facts.py E326
lib/ansible/modules/cloud/google/gcspanner.py E322
lib/ansible/modules/cloud/kubevirt/kubevirt_cdi_upload.py E203
lib/ansible/modules/cloud/linode/linode.py E322
lib/ansible/modules/cloud/linode/linode.py E324
lib/ansible/modules/cloud/lxc/lxc_container.py E210
Expand Down
9 changes: 5 additions & 4 deletions test/sanity/validate-modules/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,8 @@ def _check_for_new_args(self, doc, metadata):
return

try:
mod_version_added = StrictVersion(
mod_version_added = StrictVersion()
mod_version_added.parse(
str(existing_doc.get('version_added', '0.0'))
)
except ValueError:
Expand Down Expand Up @@ -1415,11 +1416,11 @@ def _check_for_new_args(self, doc, metadata):
continue

try:
version_added = StrictVersion(
version_added = StrictVersion()
version_added.parse(
str(details.get('version_added', '0.0'))
)
version_added.version
except (ValueError, AttributeError):
except ValueError:
version_added = details.get('version_added', '0.0')
self.reporter.error(
path=self.object_path,
Expand Down