Fix mikrotik_routeros_system_resource_print#2286
Fix mikrotik_routeros_system_resource_print#2286kwood92 wants to merge 4 commits intonetworktocode:masterfrom
Conversation
Build time regex to support v7.16+
ntc_templates/templates/mikrotik_routeros_system_resource_print.textfsm
Outdated
Show resolved
Hide resolved
Swap out \s* regex (between date and time) for a single literal space since there is always a space.
ntc_templates/templates/mikrotik_routeros_system_resource_print.textfsm
Outdated
Show resolved
Hide resolved
Both old and new build time formats use the same time format for hour:minute:second. So we can reduce the duplication by adjusting the build time regex.
Newer versions of RouterOS7 contains whitespace at the end of strings to pad it out to the end of the build-time string. New regex fixes that.
|
Thanks @mjbear |
| Value FACTORY_SOFTWARE (\S+) | ||
| Value VERSION (\S+(?:\s+\S+)*) | ||
| Value BUILD_TIME ((\d{4}-\d{2}-\d{2}|[A-Za-z]{3}\/\d{1,2}\/\d{4}) \d{2}:\d{2}:\d{2}) | ||
| Value FACTORY_SOFTWARE (\S+(?:\s+\S+)*) |
There was a problem hiding this comment.
The factory software data provided does not require a change to the regex as there only appears to be one word (not two words/strings separated with a space).
Do you have data that shows a version separated with a space?
| Value ARCHITECTURE_NAME (\S*) | ||
| Value BOARD_NAME (.+) | ||
| Value PLATFORM (.+) | ||
| Value ARCHITECTURE_NAME (\S+(?:\s+\S+)*) |
There was a problem hiding this comment.
None of the architecture name in the provided data has a space and a second word. There doesn't appear to be a reason to change the regex unless there's test data we haven't seen.
| Value PLATFORM (.+) | ||
| Value ARCHITECTURE_NAME (\S+(?:\s+\S+)*) | ||
| Value BOARD_NAME (\S+(?:\s+\S+)*) | ||
| Value PLATFORM (\S+(?:\s+\S+)*) |
There was a problem hiding this comment.
platform only shows up as a single word in the test data. There doesn't appear to be a reason to change the regex. Is there more test data?
There are questions about changes made after the initial approval.
|
@mjbear The example data is in tests/mikrotik_routeros/system_resource_print/mikrotik_routeros_system_resource_print_6.raw All the lines aside from build-time are padded out with spaces to the end of the build-time string For a visual reference, see the screenshot below: As for the comments about |
I agree, the furthest right whitespace regex (at the end of the line) may as well just be
@jvanderaa @jmcgill298 |


Build time regex to support RouterOS v7.13+