mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-20 11:52:37 +09:00
bug #4496: Do not allow to change ownership for VMs in DONE
(cherry picked from commit 36d48bfe1f)
This commit is contained in:
1 parent
026498ec26
commit
2730fdd3bc
1 file changed
+12
-1
@@ -51,7 +51,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)
|
||||
|
||||
Reference in new issue
Block a user