mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
Feature #1112: System datastores can't be deleted
This commit is contained in:
parent
4950f23652
commit
0f350b3da0
@ -125,6 +125,14 @@ int DatastorePool::drop(PoolObjectSQL * objsql, string& error_msg)
|
||||
|
||||
int rc;
|
||||
|
||||
// Return error if the datastore is a default one.
|
||||
if( datastore->get_oid() < 100 )
|
||||
{
|
||||
error_msg = "System Datastores (ID < 100) cannot be deleted.";
|
||||
NebulaLog::log("DATASTORE", Log::ERROR, error_msg);
|
||||
return -2;
|
||||
}
|
||||
|
||||
if( datastore->get_collection_size() > 0 )
|
||||
{
|
||||
ostringstream oss;
|
||||
|
@ -177,6 +177,8 @@ string Request::object_name(PoolObjectSQL::ObjectType ob)
|
||||
return "group";
|
||||
case PoolObjectSQL::ACL:
|
||||
return "ACL";
|
||||
case PoolObjectSQL::DATASTORE:
|
||||
return "datastore";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user