diff --git a/src/datastore/DatastorePool.cc b/src/datastore/DatastorePool.cc index 86788a80f9..98b084cae0 100644 --- a/src/datastore/DatastorePool.cc +++ b/src/datastore/DatastorePool.cc @@ -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; diff --git a/src/rm/Request.cc b/src/rm/Request.cc index 4b8b929b96..704eb9e2f1 100644 --- a/src/rm/Request.cc +++ b/src/rm/Request.cc @@ -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 "-"; }