Closed felixfontein closed 7 months ago
@felixfontein something is wrong with this test. I fixed a module with defaults 0
, but ansible-test can't recongnize it:
https://review.opendev.org/c/openstack/ansible-collections-openstack/+/863267/3/plugins/modules/image.py
min_disk:
description:
- The minimum disk space (in GB) required to boot this image
type: int
default: 0
min_ram:
description:
- The minimum ram (in MB) required to boot this image
type: int
default: 0
and:
min_disk=dict(type='int', default=0),
min_ram=dict(type='int', default=0),
But I still have an error:
ERROR: Found 2 validate-modules issue(s) which need to be resolved:
ERROR: plugins/modules/image.py:0:0: doc-default-does-not-match-spec: Argument 'min_disk' in argument_spec defines default as (None) but documentation defines default as (0)
ERROR: plugins/modules/image.py:0:0: doc-default-does-not-match-spec: Argument 'min_ram' in argument_spec defines default as (None) but documentation defines default as (0)
Perhaps it's a bug with processing an integer 0
?
In ansible-test from ansible-core's devel branch, https://github.com/ansible/ansible/pull/79267 updated the
validate-modules
sanity test. Now the check whetherdefault
for argument spec and documentation no longer treats falsy values that are notFalse
asNone
.This affects default values of
0
,[]
,{}
, or''
. If documentation or the argument spec uses one of these, and other other one another - orNone
-, the sanity check did not flag this in the past.