1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

B OpenNebula/one#668: support POSIX timestamp (#20)

(cherry picked from commit fa68f685a9d9a429e6721d55347e7f54502a4a2a)
This commit is contained in:
Alejandro Huertas Herrero 2020-06-18 13:51:08 +02:00 committed by Ruben S. Montero
parent 4adb8c71fd
commit b6c4691696
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
3 changed files with 12 additions and 2 deletions

View File

@ -406,7 +406,11 @@ class OneFlowHelper < OpenNebulaHelper::OneHelper
column :TIME, '', :left, :size => 67 do |d|
if d['start_time']
Time.parse(d['start_time']).to_s
if !d['start_time'].match(/^\d+$/)
Time.parse(d['start_time']).to_s
else
d['start_time']
end
else
d['recurrence']
end

View File

@ -916,7 +916,11 @@ module OpenNebula
if !(start_time.nil? || start_time.empty?)
begin
start_time = Time.parse(start_time).to_i
if !start_time.match(/^\d+$/)
start_time = Time.parse(start_time).to_i
else
start_time = start_time.to_i
end
rescue ArgumentError
# TODO: error msg
return 0

View File

@ -468,6 +468,8 @@ module OpenNebula
end
begin
next if start_time.match(/^\d+$/)
Time.parse(start_time)
rescue ArgumentError
raise Validator::ParseException,