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

B #4552: fix bug in CLI charters (#1785)

(cherry picked from commit 782e225219c6ddb8156e143c957c31b52f8eedca)
This commit is contained in:
Alejandro Huertas Herrero 2022-02-17 16:16:40 +01:00 committed by Ruben S. Montero
parent 75f4d2cf80
commit c2b7cbca4f
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -1398,16 +1398,22 @@ CommandParser::CmdParser.new(ARGV) do
acc_t = 0
acc_w = 0
charters.each do |action, time|
sched = "+#{time[:time].to_i + acc_t}"
helper.perform_action(args[0], {}, 'Charter added') do |vm|
vm.info
helper.schedule_actions([args[0]].flatten,
{ :schedule => sched },
action.to_s,
time[:warning][:time] + acc_w)
diff_stime = Time.now.to_i - vm['/VM/STIME'].to_i
acc_t += time[:time].to_i
acc_w += time[:warning][:time].to_i
charters.each do |action, time|
sched = "+#{time[:time].to_i + acc_t + diff_stime}"
helper.schedule_actions([args[0]].flatten,
{ :schedule => sched },
action.to_s,
time[:warning][:time] + acc_w)
acc_t += time[:time].to_i
acc_w += time[:warning][:time].to_i
end
end
0