mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
feature #407: reuse cluster_id in function
This commit is contained in:
parent
122a45ac28
commit
96a7dc0d9f
@ -114,10 +114,9 @@ int ClusterPool::drop(Cluster * cluster)
|
||||
int cluster_id = cluster->get_oid();
|
||||
|
||||
ostringstream where;
|
||||
where << "cid = " << cluster_id;
|
||||
|
||||
// Return error if cluster is 'default'
|
||||
if( cluster->get_oid() == DEFAULT_CLUSTER_ID )
|
||||
if( cluster_id == DEFAULT_CLUSTER_ID )
|
||||
{
|
||||
NebulaLog::log("CLUSTER",Log::WARNING,
|
||||
"Default cluster cannot be deleted.");
|
||||
@ -130,6 +129,8 @@ int ClusterPool::drop(Cluster * cluster)
|
||||
// Move the hosts assigned to the deleted cluster to the default one
|
||||
if( rc == 0 )
|
||||
{
|
||||
where << "cid = " << cluster_id;
|
||||
|
||||
hpool->search(hids, where.str());
|
||||
|
||||
for ( hid_it=hids.begin() ; hid_it < hids.end(); hid_it++ )
|
||||
|
@ -28,8 +28,8 @@
|
||||
/* ************************************************************************ */
|
||||
|
||||
Host::Host(
|
||||
int id,
|
||||
int cluster_id,
|
||||
int id,
|
||||
int cluster_id,
|
||||
const string& _hostname,
|
||||
const string& _im_mad_name,
|
||||
const string& _vmm_mad_name,
|
||||
|
Loading…
x
Reference in New Issue
Block a user