1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-25 23:21:29 +03:00

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

This commit is contained in:
Alejandro Huertas Herrero 2020-06-18 13:51:08 +02:00 committed by GitHub
parent 019fe95737
commit fa68f685a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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,