Skip to content

Commit

Permalink
Fix date removal in nonverbose config (#262)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mpas97 authored Feb 20, 2024
1 parent 10fbc56 commit 232a013
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/262-fix-date-removal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- facts - fix date not getting removed for idempotent config export (https://github.com/ansible-collections/community.routeros/pull/262).
2 changes: 1 addition & 1 deletion plugins/modules/facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ class Config(FactsBase):
'/export',
]

RM_DATE_RE = re.compile(r'^# [a-z0-9/][a-z0-9/]* [0-9:]* by RouterOS')
RM_DATE_RE = re.compile(r'^# [a-z0-9/-][a-z0-9/-]* [0-9:]* by RouterOS')

def populate(self):
super(Config, self).populate()
Expand Down

0 comments on commit 232a013

Please sign in to comment.