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(eos_config): change value validationfor parameter diff_against with value validate_config #503

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

philippebureau
Copy link

@philippebureau philippebureau commented Dec 1, 2023

SUMMARY

fixes #501

changing the value against what the module test for "replace" to append "rollback clean-config"

The previous behaviour was causing the module not to append "rollback clean-config" with method "get_session_config"

The returned "after" value was a sum of running-config + intended_config which makes the diff between before and after innacurate

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

eos_config / diff_against

ADDITIONAL INFORMATION

change the replace conditional value check to allows the returned "after" value to show the actual intended config and not a merge of intended and running-config

@philippebureau
Copy link
Author

ready to review

Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/fab331f9d2864df397ffb97ac163cd60

✔️ ansible-test-network-integration-eos-httpapi-python39-stable215 SUCCESS in 39m 59s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable214 SUCCESS in 46m 38s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable213 SUCCESS in 36m 00s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable212 SUCCESS in 37m 10s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable211 SUCCESS in 36m 38s
✔️ ansible-test-network-integration-eos-network_cli-python39-stable215-scenario01 SUCCESS in 32m 15s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable215-scenario02 SUCCESS in 36m 23s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable215-scenario01 SUCCESS in 33m 01s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable215-scenario02 SUCCESS in 36m 03s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable214-scenario01 SUCCESS in 33m 58s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable214-scenario02 SUCCESS in 40m 16s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable214-scenario01 SUCCESS in 33m 06s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable214-scenario02 SUCCESS in 40m 42s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable213-scenario01 SUCCESS in 33m 05s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable213-scenario02 SUCCESS in 39m 48s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable213-scenario01 SUCCESS in 33m 09s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable213-scenario02 SUCCESS in 39m 31s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable212-scenario01 SUCCESS in 35m 35s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable212-scenario02 SUCCESS in 34m 30s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable212-scenario01 SUCCESS in 36m 39s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable212-scenario02 SUCCESS in 38m 47s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable211-scenario01 SUCCESS in 32m 37s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable211-scenario02 SUCCESS in 39m 56s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable211-scenario01 SUCCESS in 32m 44s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable211-scenario02 SUCCESS in 40m 01s (non-voting)
✔️ build-ansible-collection SUCCESS in 9m 53s
✔️ ansible-tox-linters SUCCESS in 12m 12s
✔️ ansible-galaxy-importer SUCCESS in 4m 01s

@philippebureau philippebureau changed the title fix(eos_config): disable replace variable override for parameter diff_against with value validate_config fix(eos_config): change value validationfor parameter diff_against with value validate_config Dec 4, 2023
@github-actions github-actions bot added the bug This issue/PR relates to a bug. label Dec 13, 2023
Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.76%. Comparing base (c1950c9) to head (6d25a6f).

❗ Current head 6d25a6f differs from pull request most recent head 8872830. Consider uploading reports for the commit 8872830 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #503   +/-   ##
=======================================
  Coverage   82.76%   82.76%           
=======================================
  Files         153      153           
  Lines       11967    11967           
=======================================
  Hits         9904     9904           
  Misses       2063     2063           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/59947bccc03c4b4da9af25e9507daf2e

✔️ ansible-test-network-integration-eos-httpapi-python39-stable215 SUCCESS in 39m 43s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable214 SUCCESS in 44m 02s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable213 SUCCESS in 39m 53s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable212 SUCCESS in 40m 05s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable211 SUCCESS in 38m 03s
✔️ ansible-test-network-integration-eos-network_cli-python39-stable215-scenario01 SUCCESS in 33m 01s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable215-scenario02 SUCCESS in 35m 45s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable215-scenario01 SUCCESS in 34m 13s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable215-scenario02 SUCCESS in 36m 18s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable214-scenario01 SUCCESS in 32m 29s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable214-scenario02 SUCCESS in 37m 08s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable214-scenario01 SUCCESS in 38m 14s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable214-scenario02 SUCCESS in 34m 44s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable213-scenario01 SUCCESS in 31m 53s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable213-scenario02 SUCCESS in 34m 17s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable213-scenario01 SUCCESS in 31m 16s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable213-scenario02 SUCCESS in 39m 14s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable212-scenario01 SUCCESS in 35m 50s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable212-scenario02 SUCCESS in 38m 35s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable212-scenario01 SUCCESS in 35m 26s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable212-scenario02 SUCCESS in 35m 34s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable211-scenario01 SUCCESS in 32m 57s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable211-scenario02 SUCCESS in 35m 29s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable211-scenario01 SUCCESS in 33m 19s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable211-scenario02 SUCCESS in 35m 48s (non-voting)
✔️ build-ansible-collection SUCCESS in 10m 09s
✔️ ansible-tox-linters SUCCESS in 12m 37s
✔️ ansible-galaxy-importer SUCCESS in 4m 48s

@rohitthakur2590
Copy link
Contributor

@philippebureau Thank for the contribution. Could you please changelog and test it if possible?

Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/53b0a9402c93407eb5431d34eb16597c

✔️ ansible-test-network-integration-eos-httpapi-python39-stable215 SUCCESS in 40m 01s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable214 SUCCESS in 45m 20s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable213 SUCCESS in 35m 17s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable212 SUCCESS in 35m 23s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable211 SUCCESS in 35m 26s
✔️ ansible-test-network-integration-eos-network_cli-python39-stable215-scenario01 SUCCESS in 31m 54s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable215-scenario02 SUCCESS in 35m 12s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable215-scenario01 SUCCESS in 32m 56s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable215-scenario02 SUCCESS in 34m 34s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable214-scenario01 SUCCESS in 32m 26s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable214-scenario02 SUCCESS in 39m 06s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable214-scenario01 SUCCESS in 31m 41s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable214-scenario02 SUCCESS in 39m 22s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable213-scenario01 SUCCESS in 31m 05s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable213-scenario02 SUCCESS in 39m 18s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable213-scenario01 SUCCESS in 32m 20s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable213-scenario02 SUCCESS in 39m 02s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable212-scenario01 SUCCESS in 31m 57s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable212-scenario02 SUCCESS in 38m 25s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable212-scenario01 SUCCESS in 33m 39s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable212-scenario02 SUCCESS in 37m 33s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable211-scenario01 SUCCESS in 33m 28s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable211-scenario02 SUCCESS in 38m 28s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable211-scenario01 SUCCESS in 32m 56s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable211-scenario02 SUCCESS in 38m 59s (non-voting)
✔️ build-ansible-collection SUCCESS in 9m 53s
✔️ ansible-tox-linters SUCCESS in 12m 00s
✔️ ansible-galaxy-importer SUCCESS in 5m 11s

@philippebureau
Copy link
Author

@philippebureau Thank for the contribution. Could you please changelog and test it if possible?

done

@rohitthakur2590
Copy link
Contributor

@philippebureau This looks good, thanks for adding the changelog, could you please also add the integration test,
you can add one more task in this file and have an assertion for the result.

@philippebureau
Copy link
Author

the

@philippebureau This looks good, thanks for adding the changelog, could you please also add the integration test, you can add one more task in this file and have an assertion for the result.

the diff_against already had a an integration test. here

The assertion in the current test is valid.

Does the test need to be extended?

Copy link

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/5ef69cab5d43417bb1b7a1ee7ee03b79

✔️ ansible-test-network-integration-eos-httpapi-python39-stable215 SUCCESS in 40m 53s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable214 SUCCESS in 42m 47s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable213 SUCCESS in 39m 22s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable212 SUCCESS in 40m 04s
✔️ ansible-test-network-integration-eos-httpapi-python39-stable211 SUCCESS in 40m 45s
✔️ ansible-test-network-integration-eos-network_cli-python39-stable215-scenario01 SUCCESS in 32m 19s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable215-scenario02 SUCCESS in 34m 46s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable215-scenario01 SUCCESS in 32m 06s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable215-scenario02 SUCCESS in 35m 13s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable214-scenario01 SUCCESS in 37m 34s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable214-scenario02 SUCCESS in 37m 51s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable214-scenario01 SUCCESS in 32m 19s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable214-scenario02 SUCCESS in 40m 54s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable213-scenario01 SUCCESS in 31m 02s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable213-scenario02 SUCCESS in 39m 56s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable213-scenario01 SUCCESS in 31m 12s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable213-scenario02 SUCCESS in 39m 51s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable212-scenario01 SUCCESS in 31m 14s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable212-scenario02 SUCCESS in 40m 03s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable212-scenario01 SUCCESS in 36m 25s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable212-scenario02 SUCCESS in 39m 51s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable211-scenario01 SUCCESS in 35m 40s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-python39-stable211-scenario02 SUCCESS in 38m 22s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable211-scenario01 SUCCESS in 35m 48s (non-voting)
✔️ ansible-test-network-integration-eos-network_cli-libssh-python39-stable211-scenario02 SUCCESS in 38m 40s (non-voting)
✔️ build-ansible-collection SUCCESS in 10m 45s
✔️ ansible-tox-linters SUCCESS in 12m 13s
✔️ ansible-galaxy-importer SUCCESS in 5m 10s

@philippebureau
Copy link
Author

@cidrblock as per discussed today at Redhat summit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

diff_against parameter in eos_config module does not use "rollback clean-config"
2 participants