mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
Use today as a default 'from' value
This commit is contained in:
parent
f80dad32c2
commit
7d013a4c2f
1 changed files with 4 additions and 2 deletions
|
|
@ -258,8 +258,10 @@ module Vmpooler
|
||||||
halt 400, 'Invalid "to" date format, must match YYYY-MM-DD'
|
halt 400, 'Invalid "to" date format, must match YYYY-MM-DD'
|
||||||
end
|
end
|
||||||
|
|
||||||
# We do need a from date, however.
|
# It is also ok if from_param is nil, we will assume this also means 'today'
|
||||||
if from_param.nil? or !validate_date_str(from_param.to_s)
|
if from_param.nil?
|
||||||
|
from_param = Date.today.to_s
|
||||||
|
elsif !validate_date_str(from_param.to_s)
|
||||||
halt 400, 'Invalid "from" date format, must match YYYY-MM-DD'
|
halt 400, 'Invalid "from" date format, must match YYYY-MM-DD'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue