# set service dhcp-server shared-network-name FOO subnet 192.0.2.0/24 time-offset 3600 usage: validate-value.py [-h] [--regex REGEX] [--exec EXEC] [--value VALUE] validate-value.py: error: argument --regex: expected one argument Invalid time offset value Value validation failed Set failed
Validator is regex in vyos-1x interface-definitions/dhcp-server.xml:
<leafNode name="time-offset"> <properties> <help>Offset of the client's subnet in seconds from Coordinated Universal Time (UTC)</help> <valueHelp> <format>[-]N</format> <description>Time offset (number, may be negative)</description> </valueHelp> <constraint> <regex>-?[0-9]+</regex> </constraint> <constraintErrorMessage>Invalid time offset value</constraintErrorMessage>
At first I thought this may be due to my recent commit 377c04cb:
- <regex>^-?[0-9]+$</regex> + <regex>-?[0-9]+</regex>
It was my understanding that ^ and $ are unecessary as they are implied by default. Indeed removing them from other regexes in the same file had no negative effects. But the validator seems to be broken in some other way as it complains about expecting one argument, suggesting it gets 0 or more than 1 arguments.