mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
feature #3175: Security Group 0 cannot be deleted
This commit is contained in:
parent
b57ccf38ed
commit
bf6eb1965c
@ -379,6 +379,15 @@ int VirtualNetworkDelete::drop(int oid, PoolObjectSQL * object, string& error_ms
|
||||
|
||||
int SecurityGroupDelete::drop(int oid, PoolObjectSQL * object, string& error_msg)
|
||||
{
|
||||
if (object->get_oid() == 0)
|
||||
{
|
||||
error_msg = "The default security group (ID 0) cannot be deleted.";
|
||||
|
||||
object->unlock();
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
SecurityGroup * sgroup = static_cast<SecurityGroup *>(object);
|
||||
|
||||
if ( sgroup->get_vms() > 0 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user