From 5c54e1c5f2a2b08c61397f2139851b6f545007a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 11 Mar 2016 15:44:56 +0100 Subject: [PATCH] Feature #4369: Do not add objects to cluster -1 on allocate --- src/rm/RequestManagerAllocate.cc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/rm/RequestManagerAllocate.cc b/src/rm/RequestManagerAllocate.cc index bf554cb389..cdeae2a1d9 100644 --- a/src/rm/RequestManagerAllocate.cc +++ b/src/rm/RequestManagerAllocate.cc @@ -273,7 +273,11 @@ int VirtualNetworkAllocate::pool_allocate( VirtualNetworkTemplate * vtmpl=static_cast(tmpl); set cluster_ids; - cluster_ids.insert(cluster_id); + + if (cluster_id != ClusterPool::NONE_CLUSTER_ID) + { + cluster_ids.insert(cluster_id); + } return vpool->allocate(att.uid, att.gid, att.uname, att.gname, att.umask,-1, vtmpl, &id, cluster_ids, att.resp_msg); @@ -630,7 +634,11 @@ int HostAllocate::pool_allocate( HostPool * hpool = static_cast(pool); set cluster_ids; - cluster_ids.insert(cluster_id); + + if (cluster_id != ClusterPool::NONE_CLUSTER_ID) + { + cluster_ids.insert(cluster_id); + } return hpool->allocate(&id, host, im_mad, vmm_mad, vnm_mad, cluster_ids, att.resp_msg); @@ -718,7 +726,11 @@ int DatastoreAllocate::pool_allocate( DatastoreTemplate * ds_tmpl = static_cast(tmpl); set cluster_ids; - cluster_ids.insert(cluster_id); + + if (cluster_id != ClusterPool::NONE_CLUSTER_ID) + { + cluster_ids.insert(cluster_id); + } return dspool->allocate(att.uid, att.gid, att.uname, att.gname, att.umask, ds_tmpl, &id, cluster_ids, att.resp_msg);