1
0
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:
Carlos Martín 2012-02-15 17:37:30 +01:00
parent 4950f23652
commit 0f350b3da0
2 changed files with 10 additions and 0 deletions

View File

@ -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;

View File

@ -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 "-";
}