mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-22 22:03:39 +03:00
Feature #1112: Return an error message when DS 0 (system) is added to any cluster
This commit is contained in:
parent
ef1aa42cf9
commit
7a89275c2b
@ -19,6 +19,7 @@
|
||||
|
||||
#include "PoolSQL.h"
|
||||
#include "ObjectCollection.h"
|
||||
#include "DatastorePool.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -77,6 +78,17 @@ public:
|
||||
*/
|
||||
int add_datastore(int id, string& error_msg)
|
||||
{
|
||||
if ( id == DatastorePool::SYSTEM_DS_ID )
|
||||
{
|
||||
ostringstream oss;
|
||||
oss << "Datastore '"<< DatastorePool::SYSTEM_DS_NAME
|
||||
<< "' cannot be added to any cluster.";
|
||||
|
||||
error_msg = oss.str();
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int rc = datastores.add_collection_id(id);
|
||||
|
||||
if ( rc < 0 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user