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 date removal in nonverbose config #262

Merged
merged 2 commits into from
Feb 20, 2024
Merged

Fix date removal in nonverbose config #262

merged 2 commits into from
Feb 20, 2024

Conversation

mpas97
Copy link
Contributor

@mpas97 mpas97 commented Feb 20, 2024

SUMMARY

As in newer versions of RouterOS the date format in the export is 2024-10-02 and no longer 2024/10/02, the regex to remove timestamps did no longer match all cases. This is fixed here.

CONTEXT

Documentation says that, the ansible_net_config_nonverbose fact is idempotent in the sense that if the facts module is run twice and the device’s config was not changed between the runs, the value is identical. This is achieved by running /export and stripping the timestamp from the comment in the first line.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

facts

ADDITIONAL INFORMATION

Date was successfully removed from export in RouterOS 7.9.* but not in 7.12.*

As in newer versions of RouterOS the date format is 2024-10-02 and no longer 2024/10/02, the regex did no longer match all cases. This is fixed.
@felixfontein
Copy link
Collaborator

Thanks for your contribution! Could you please add a changelog fragment? Thanks!

Copy link

codecov bot commented Feb 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (10fbc56) 82.97% compared to head (33b11ba) 82.97%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #262   +/-   ##
=======================================
  Coverage   82.97%   82.97%           
=======================================
  Files          32       32           
  Lines        4046     4046           
  Branches      871      871           
=======================================
  Hits         3357     3357           
  Misses        506      506           
  Partials      183      183           
Flag Coverage Δ
integration 66.86% <ø> (ø)
sanity 22.10% <100.00%> (ø)
units 82.91% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@felixfontein felixfontein merged commit 232a013 into ansible-collections:main Feb 20, 2024
45 checks passed
@felixfontein
Copy link
Collaborator

@mpas97 thank you very much for fixing this!
@derdeagle thanks for reviewing!

samburney pushed a commit to samburney/community.routeros that referenced this pull request Mar 30, 2024
* Fix date removal in nonverbose config

As in newer versions of RouterOS the date format is 2024-10-02 and no longer 2024/10/02, the regex did no longer match all cases. This is fixed.

* Add changelog fragment
samburney pushed a commit to samburney/community.routeros that referenced this pull request Mar 30, 2024
* Fix date removal in nonverbose config

As in newer versions of RouterOS the date format is 2024-10-02 and no longer 2024/10/02, the regex did no longer match all cases. This is fixed.

* Add changelog fragment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants