ansible-collections / community.routeros

Ansible modules for managing MikroTik RouterOS instances.
https://galaxy.ansible.com/ui/repo/published/community/routeros/
GNU General Public License v3.0
95 stars 44 forks source link

Fix date removal in nonverbose config #262

Closed mpas97 closed 6 months ago

mpas97 commented 6 months ago
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
COMPONENT NAME

facts

ADDITIONAL INFORMATION

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

felixfontein commented 6 months ago

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

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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](https://app.codecov.io/gh/ansible-collections/community.routeros/pull/262/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansible-collections) | Coverage Δ | | |---|---|---| | [integration](https://app.codecov.io/gh/ansible-collections/community.routeros/pull/262/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansible-collections) | `66.86% <ø> (ø)` | | | [sanity](https://app.codecov.io/gh/ansible-collections/community.routeros/pull/262/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansible-collections) | `22.10% <100.00%> (ø)` | | | [units](https://app.codecov.io/gh/ansible-collections/community.routeros/pull/262/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansible-collections) | `82.91% <100.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ansible-collections#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

felixfontein commented 6 months ago

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