Feature #1112: System datastores can't be deleted

This commit is contained in:
Carlos Martín committed 2012-02-15 17:37:30 +01:00
1 parent 4950f23652
commit 0f350b3da0
2 files changed
+10

No files matched your search

+8
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;
+2
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 "-";
}