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

Use of private attribute module._CHECK_ARGUMENT_TYPES_DISPATCHER #186

Open
samdoran opened this issue Dec 17, 2020 · 0 comments · May be fixed by #234
Open

Use of private attribute module._CHECK_ARGUMENT_TYPES_DISPATCHER #186

samdoran opened this issue Dec 17, 2020 · 0 comments · May be fixed by #234
Labels
has_pr This issue has an associated PR.

Comments

@samdoran
Copy link

samdoran commented Dec 17, 2020

SUMMARY

As part of the role argument spec validation work for Ansible 2.11 (ansible/ansible#72667), the private attribute AnsibleModule._CHECK_ARGUMENT_TYPES_DISPATCHER moved to to lib/ansible/module_utils/common/parameters.py. Any code using that private attribute should instead use DEFAULT_TYPE_VALIDATORS or preferably get_validator() from the new location.

I left in AnsibleModule._CHECK_ARGUMENT_TYPES_DISPATCHER for backwards compatibility.

I mainly just wanted to give you a heads up that things are moving, though I did my best to make sure nothing would break.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ansible/netcommon/plugins/module_utils/network/common/utils.py

ANSIBLE VERSION
ansible 2.11.0.dev0 (arg_spec/get_wanted_type 5ca601bfca) last updated 2020/12/17 15:18:08 (GMT -400)
  config file = /Users/sdoran/.ansible.cfg
  configured module search path = ['/usr/local/share/ansible/library']
  ansible python module location = /Users/sdoran/Source/ansible/lib/ansible
  ansible collection location = /Users/sdoran/.ansible/collections:/usr/local/share/ansible/collections
  executable location = /Users/sdoran/Source/ansible/bin/ansible
  python version = 3.9.0 (default, Oct 14 2020, 11:40:34) [Clang 12.0.0 (clang-1200.0.32.2)]
  jinja version = 2.11.2
  libyaml = True
CONFIGURATION
> ansible-config dump --only-changed
DEFAULT_LOG_PATH(env: ANSIBLE_LOG_PATH) = /Users/sdoran/.ansible/ansible.log
DEFAULT_VAULT_PASSWORD_FILE(env: ANSIBLE_VAULT_PASSWORD_FILE) = /Users/sdoran/bin/getvaultkey.sh
DEVEL_WARNING(env: ANSIBLE_DEVEL_WARNING) = False
OS / ENVIRONMENT
ProductName:	Mac OS X
ProductVersion:	10.15.7
BuildVersion:	19H114
STEPS TO REPRODUCE

Search for uses of ._CHECK_ARGUMENT_TYPES_DISPATCHER

EXPECTED RESULTS

No uses found.

ACTUAL RESULTS

Several instances found.

> ag \._CHECK_ARGUMENT_TYPES_DISPATCHER
cisco/nxos/plugins/modules/nxos_user.py
333:        type_checker = module._CHECK_ARGUMENT_TYPES_DISPATCHER[value_type]

cisco/ios/plugins/modules/ios_vrf.py
586:        type_checker = module._CHECK_ARGUMENT_TYPES_DISPATCHER[value_type]

cisco/ios/plugins/modules/ios_user.py
486:        type_checker = module._CHECK_ARGUMENT_TYPES_DISPATCHER[value_type]

ansible/netcommon/plugins/module_utils/network/common/utils.py
291:                type_checker = self._module._CHECK_ARGUMENT_TYPES_DISPATCHER[

junipernetworks/junos/plugins/modules/junos_user.py
251:        type_checker = module._CHECK_ARGUMENT_TYPES_DISPATCHER[value_type]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has_pr This issue has an associated PR.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants