1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-03 13:47:01 +03:00

B #6068: Fix authorization for onevm disk-resize (#2468)

Also fix error code for onevm create-chart

(cherry picked from commit 18a4796ea16704966ba34a04f08dbb2068479ab8)
This commit is contained in:
Pavel Czerný 2023-01-31 12:04:05 +01:00 committed by Ruben S. Montero
parent 3c9bfecbd1
commit 8f99e99236
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
3 changed files with 22 additions and 5 deletions

View File

@ -464,7 +464,11 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
tmp_str << "TIME = #{options[:schedule]}"
tmp_str << str_periodic << ']'
vm.sched_action_add(tmp_str)
rc = vm.sched_action_add(tmp_str)
if OpenNebula.is_error?(rc)
return rc
end
end
end

View File

@ -1507,10 +1507,15 @@ CommandParser::CmdParser.new(ARGV) do
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)
rc = helper.schedule_actions([args[0]].flatten,
{ :schedule => sched },
action.to_s,
time[:warning][:time] + acc_w)
if OpenNebula.is_error?(rc)
STDERR.puts rc.message
exit(-1)
end
acc_t += time[:time].to_i
acc_w += time[:warning][:time].to_i

View File

@ -3637,6 +3637,14 @@ void VirtualMachineDiskResize::request_execute(
return;
}
// -------------------------------------------------------------------------
// Authorize the operation
// -------------------------------------------------------------------------
if (vm_authorization(id, 0, 0, att, 0, 0, 0) == false)
{
return;
}
bool img_ds_quota, vm_ds_quota;
int img_id = -1;