Add a validator to prevent conflicting clock configs

This is a second layer of protection, to make the behavior minimally
surprising for the user.  The implementation of clock_* handlers follows
a precedence decision order in case of conflict, but that shouldn't be
relied on as the only layer of defense against bad configs.
This commit is contained in:
Bart Kus 2023-02-01 10:40:15 -08:00
parent 78e46979e0
commit 2213314a5c

View File

@ -1249,6 +1249,10 @@ module VagrantPlugins
end
end
if [@clock_absolute, @clock_adjustment, @clock_timezone].count {|clock| !clock.nil?} > 1
errors << "At most, only one of [clock_absolute, clock_adjustment, clock_timezone] may be set."
end
errors = validate_sysinfo(machine, errors)
{ 'Libvirt Provider' => errors }