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

Fix: cv_validate_v3 broken with cvprac 1.4.0 due to argument keyword change #694

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

noredistribution
Copy link
Contributor

@noredistribution noredistribution commented May 24, 2024

Change Summary

cvprac updated the keyword arguments for validate_config_for_device() from device_mac to dev_mac in aristanetworks/cvprac@69fd313#diff-ff77c7a073e87f20dd555db78c0b2ee12ed8924d0cc12645fb2e33034ec523aaL1359 and playbooks are failing with:

    Traceback (most recent call last):
      File "/home/pprad133/.ansible/tmp/ansible-local-175841olddsl1/ansible-tmp-1716569183.2255661-17610-80870313378101/AnsiballZ_cv_validate_v3.py", line 107, in <module>
        _ansiballz_main()
      File "/home/pprad133/.ansible/tmp/ansible-local-175841olddsl1/ansible-tmp-1716569183.2255661-17610-80870313378101/AnsiballZ_cv_validate_v3.py", line 99, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/home/pprad133/.ansible/tmp/ansible-local-175841olddsl1/ansible-tmp-1716569183.2255661-17610-80870313378101/AnsiballZ_cv_validate_v3.py", line 47, in invoke_module
        runpy.run_module(mod_name='ansible_collections.arista.cvp.plugins.modules.cv_validate_v3', init_globals=dict(_module_fqn='ansible_collections.arista.cvp.plugins.modules.cv_validate_v3', _modlib_path=modlib_path),
      File "/usr/lib/python3.10/runpy.py", line 224, in run_module
        return _run_module_code(code, init_globals, run_name, mod_spec)
      File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code
        _run_code(code, mod_globals, init_globals,
      File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
        exec(code, run_globals)
      File "/tmp/ansible_arista.cvp.cv_validate_v3_payload_igauvor3/ansible_arista.cvp.cv_validate_v3_payload.zip/ansible_collections/arista/cvp/plugins/modules/cv_validate_v3.py", line 163, in <module>
      File "/tmp/ansible_arista.cvp.cv_validate_v3_payload_igauvor3/ansible_arista.cvp.cv_validate_v3_payload.zip/ansible_collections/arista/cvp/plugins/modules/cv_validate_v3.py", line 153, in main
      File "/tmp/ansible_arista.cvp.cv_validate_v3_payload_igauvor3/ansible_arista.cvp.cv_validate_v3_payload.zip/ansible_collections/arista/cvp/plugins/module_utils/validate_tools.py", line 194, in manager
    TypeError: CvpApi.validate_config_for_device() got an unexpected keyword argument 'device_mac'
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1

Thanks for @pmprado for reporting

Related Issue(s)

Fixes #

Component(s) name

arista.cvp.cv_validate_v3

Proposed changes

removed the keyword argument name and just passing the vars

How to test

Checklist

User Checklist

  • N/A

Repository Checklist

  • My code has been rebased from devel before I start
  • [x ] I have read the CONTRIBUTING document.
  • My change requires a change to the documentation and documentation have been updated accordingly. (check the box if not applicable)
  • I have updated molecule CI testing accordingly. (check the box if not applicable)

@github-actions github-actions bot added the module_utils: cv_client cv_client implementation issue label May 24, 2024
Copy link

@pmprado pmprado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great and worked fine testing in a production environment.

Copy link

sonarcloud bot commented May 24, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@sugetha24 sugetha24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module_utils: cv_client cv_client implementation issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants