diff --git a/src/cluster/ClusterPool.cc b/src/cluster/ClusterPool.cc index ae5ff899c1..6628a25174 100644 --- a/src/cluster/ClusterPool.cc +++ b/src/cluster/ClusterPool.cc @@ -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++ ) diff --git a/src/host/Host.cc b/src/host/Host.cc index c9abd04839..78bbb93872 100644 --- a/src/host/Host.cc +++ b/src/host/Host.cc @@ -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,