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

bug : Do not allow to change ownership for VMs in DONE

This commit is contained in:
Ruben S. Montero 2016-06-01 16:10:07 +02:00
parent 320e58eacc
commit 36d48bfe1f

@ -48,7 +48,18 @@ PoolObjectSQL * RequestManagerChown::get_and_quota(
if (auth_object == PoolObjectSQL::VM)
{
tmpl = (static_cast<VirtualMachine*>(object))->clone_template();
VirtualMachine * vm = static_cast<VirtualMachine*>(object);
if ( vm->get_state() == VirtualMachine::DONE )
{
vm->unlock();
att.resp_msg = "Could not change VM ownership, wrong state";
failure_response(ACTION, att);
return 0;
}
tmpl = vm->clone_template();
qtype = Quotas::VIRTUALMACHINE;
}
else if (auth_object == PoolObjectSQL::IMAGE)