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

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

This commit is contained in:
Alejandro Huertas Herrero 2022-02-17 16:16:40 +01:00 committed by GitHub
parent ea1ffe8149
commit 782e225219
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1428,16 +1428,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