Skip to content

Fix sanity test "validate-modules" errors #729

@chidanandpujar

Description

@chidanandpujar

Steps:
mkdir ansible_sanity_tests_check1

git clone https://github.com/Juniper/ansible-junos-stdlib.git

cd /root/ansible_sanity_tests_check1/ansible-junos-stdlib/ansible_collections/juniper/device/tests

root@masterhost:~/ansible_sanity_tests_check1/ansible-junos-stdlib/ansible_collections/juniper/device/tests# ansible-test sanity
Running sanity test "action-plugin-docs"
Running sanity test "ansible-doc"
Running sanity test "changelog"
Running sanity test "compile" on Python 3.8
WARNING: Skipping sanity test "compile" on Python 3.9 because it could not be found.
WARNING: Skipping sanity test "compile" on Python 3.10 because it could not be found.
WARNING: Skipping sanity test "compile" on Python 3.11 because it could not be found.
Running sanity test "compile" on Python 3.12
WARNING: Skipping sanity test "compile" on Python 3.13 because it could not be found.
Running sanity test "empty-init"
Running sanity test "ignores"
Running sanity test "import" on Python 3.8
WARNING: Skipping sanity test "import" on Python 3.9 because it could not be found.
WARNING: Skipping sanity test "import" on Python 3.10 because it could not be found.
WARNING: Skipping sanity test "import" on Python 3.11 because it could not be found.
Running sanity test "import" on Python 3.12
WARNING: Skipping sanity test "import" on Python 3.13 because it could not be found.
Running sanity test "line-endings"
Running sanity test "no-assert"
Running sanity test "no-get-exception"
Running sanity test "no-illegal-filenames"
Running sanity test "no-smart-quotes"
Running sanity test "pep8"
Running sanity test "pslint"
Running sanity test "pylint"
Running sanity test "replace-urlopen"
Running sanity test "runtime-metadata"
Running sanity test "shebang"
Running sanity test "shellcheck"
Running sanity test "symlinks"
Running sanity test "use-argspec-type-path"
Running sanity test "use-compat-six"
Running sanity test "validate-modules"
ERROR: Found 35 validate-modules issue(s) which need to be resolved:
ERROR: plugins/modules/facts.py:0:0: doc-default-does-not-match-spec: Argument 'attempts' in argument_spec defines default as (None) but documentation defines default as (10)
ERROR: plugins/modules/facts.py:0:0: doc-default-does-not-match-spec: Argument 'baud' in argument_spec defines default as (None) but documentation defines default as (9600)
ERROR: plugins/modules/facts.py:0:0: doc-default-does-not-match-spec: Argument 'config_format' in argument_spec defines default as (None) but documentation defines default as ('none')
ERROR: plugins/modules/facts.py:0:0: doc-default-does-not-match-spec: Argument 'console' in argument_spec defines default as (None) but documentation defines default as ('none')
ERROR: plugins/modules/facts.py:0:0: doc-default-does-not-match-spec: Argument 'host' in argument_spec defines default as (None) but documentation defines default as ('C({{ inventory_hostname }})')
ERROR: plugins/modules/facts.py:0:0: doc-default-does-not-match-spec: Argument 'level' in argument_spec defines default as (None) but documentation defines default as ('WARNING')
ERROR: plugins/modules/facts.py:0:0: doc-default-does-not-match-spec: Argument 'logdir' in argument_spec defines default as (None) but documentation defines default as ('none')
ERROR: plugins/modules/facts.py:0:0: doc-default-does-not-match-spec: Argument 'logfile' in argument_spec defines default as (None) but documentation defines default as ('none')
ERROR: plugins/modules/facts.py:0:0: doc-default-does-not-match-spec: Argument 'mode' in argument_spec defines default as (None) but documentation defines default as ('none')
ERROR: plugins/modules/facts.py:0:0: doc-default-does-not-match-spec: Argument 'passwd' in argument_spec defines default as (None) but documentation defines default as ('The first defined value from the following list 1) The C(ANSIBLE_NET_PASSWORD) environment variable. (used by Ansible Tower) 2) The value specified using the C(-k) or C(--ask-pass) command line arguments to the C(ansible) or C(ansible-playbook) command. 3) none (An empty password/passphrase)')
ERROR: plugins/modules/facts.py:0:0: doc-default-does-not-match-spec: Argument 'port' in argument_spec defines default as (None) but documentation defines default as ("C(830) if C(mode = none), C(23) if C(mode = 'telnet'), C('/dev/ttyUSB0') if (mode = 'serial')")
ERROR: plugins/modules/facts.py:0:0: doc-default-does-not-match-spec: Argument 'savedir' in argument_spec defines default as (None) but documentation defines default as ('none')
ERROR: plugins/modules/facts.py:0:0: doc-default-does-not-match-spec: Argument 'ssh_private_key_file' in argument_spec defines default as (None) but documentation defines default as ("The first defined value from the following list 1) The C(ANSIBLE_NET_SSH_KEYFILE) environment variable. (used by Ansible Tower) 2) The value specified using the C(--private-key) or C(--key-file) command line arguments to the C(ansible) or C(ansible-playbook) command. 3) none (the file specified in the user's SSH configuration, or the operating-system-specific default)")
ERROR: plugins/modules/facts.py:0:0: doc-default-does-not-match-spec: Argument 'user' in argument_spec defines default as (None) but documentation defines default as ('The first defined value from the following list 1) The C(ANSIBLE_NET_USERNAME) environment variable. (used by Ansible Tower) 2) The C(remote_user) as defined by Ansible. Ansible sets this value via several methods including a) C(-u) or C(--user) command line arguments to the C(ansible) or C(ansible-playbook) command. b) C(ANSIBLE_REMOTE_USER) environment variable. c) C(remote_user) configuration setting. See the Ansible documentation for the precedence used to set the C(remote_user) value. 3) The C(USER) environment variable.')
ERROR: plugins/modules/facts.py:0:0: doc-missing-type: Argument 'config_format' in argument_spec uses default type ('str') but documentation doesn't define type
ERROR: plugins/modules/facts.py:0:0: doc-required-mismatch: Argument 'host' in argument_spec is not required, but is documented as being required
ERROR: plugins/modules/facts.py:0:0: doc-required-mismatch: Argument 'user' in argument_spec is not required, but is documented as being required
ERROR: plugins/modules/facts.py:0:0: doc-type-does-not-match-spec: Argument 'port' in argument_spec defines type as 'str' but documentation defines type as 'int or str'
ERROR: plugins/modules/facts.py:0:0: incompatible-choices: Argument 'config_format' in argument_spec defines choices as (None) but this is incompatible with argument type 'str'
ERROR: plugins/modules/facts.py:0:0: incompatible-choices: Argument 'level' in argument_spec defines choices as (None) but this is incompatible with argument type 'str'
ERROR: plugins/modules/facts.py:0:0: incompatible-choices: Argument 'mode' in argument_spec defines choices as (None) but this is incompatible with argument type 'str'
ERROR: plugins/modules/facts.py:0:0: invalid-ansiblemodule-schema: AnsibleModule.mutually_exclusive.6: expected list @ data['mutually_exclusive'][6]. Got 'logfile'
ERROR: plugins/modules/facts.py:0:0: invalid-ansiblemodule-schema: AnsibleModule.mutually_exclusive.7: expected list @ data['mutually_exclusive'][7]. Got 'logdir'
ERROR: plugins/modules/facts.py:0:0: invalid-documentation: DOCUMENTATION.options.port.type: not a valid value for dictionary value @ data['options']['port']['type']. Got 'int or str'
ERROR: plugins/modules/facts.py:0:0: missing-gplv3-license: GPLv3 license header not found in the first 20 lines of the module
ERROR: plugins/modules/facts.py:0:0: no-default-for-required-parameter: DOCUMENTATION.options.host: Argument is marked as required but specifies a default. Arguments with a default should not be marked as required for dictionary value @ data['options']['host']. Got {'description': ['The hostname or IP address of the Junos device to which the connection should be established. This is normally the Junos device itself, but is the hostname or IP address of a console server when connecting to the console of the device by setting the I(mode) option to the value C(telnet). This option is required, but does not have to be specified explicitly by the user because it defaults to C({{ inventory_hostname }}).'], 'required': True, 'default': 'C({{ inventory_hostname...
ERROR: plugins/modules/facts.py:0:0: no-default-for-required-parameter: DOCUMENTATION.options.user: Argument is marked as required but specifies a default. Arguments with a default should not be marked as required for dictionary value @ data['options']['user']. Got {'description': ['The username used to authenticate with the Junos device. This option is required, but does not have to be specified explicitly by the user due to the algorithm for determining the default value.'], 'required': True, 'default': 'The first defined value from the following list 1) The C(ANSIBLE_NET_USERNAME) environment variable. (used by Ansible Tower) 2) The C(remote_user) as defined by Ansible. Ansible sets this value via several methods including a) C(-u) or C(--user) comma...
ERROR: plugins/modules/facts.py:0:0: nonexistent-parameter-documented: Argument 'log_dir' is listed in DOCUMENTATION.options, but not accepted by the module argument_spec
ERROR: plugins/modules/facts.py:0:0: nonexistent-parameter-documented: Argument 'log_file' is listed in DOCUMENTATION.options, but not accepted by the module argument_spec
ERROR: plugins/modules/facts.py:0:0: parameter-documented-aliases-differ: Argument 'logdir' in argument_spec has names 'logdir', but its documentation has names 'log_dir', 'logdir'
ERROR: plugins/modules/facts.py:0:0: parameter-documented-aliases-differ: Argument 'logfile' in argument_spec has names 'logfile', but its documentation has names 'log_file', 'logfile'
ERROR: plugins/modules/facts.py:0:0: undocumented-parameter: Argument '_connection' is listed in the argument_spec, but not documented in the module documentation
ERROR: plugins/modules/facts.py:0:0: undocumented-parameter: Argument '_inventory_hostname' is listed in the argument_spec, but not documented in the module documentation
ERROR: plugins/modules/facts.py:0:0: undocumented-parameter: Argument '_module_name' is listed in the argument_spec, but not documented in the module documentation
ERROR: plugins/modules/facts.py:0:0: undocumented-parameter: Argument '_module_utils_path' is listed in the argument_spec, but not documented in the module documentation
See documentation for help: https://docs.ansible.com/ansible-core/2.18/dev_guide/testing/sanity/validate-modules.html
Running sanity test "yamllint"
FATAL: The 1 sanity test(s) listed below (out of 34) failed. See error output above for details.
validate-modules

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions