From 8e462ba3481c7eedf95ffb01551481f6f41df421 Mon Sep 17 00:00:00 2001 From: ribes Date: Wed, 6 Jan 2010 14:24:37 +0000 Subject: [PATCH] - Check if we add a resource already added - Write a warning and kepp last resource found --- src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx index b41a5aa56..b5c52eba1 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx @@ -129,6 +129,9 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) _resource.DataForSort._Name = Kernel_Utils::GetHostname(); } } + map::const_iterator iter = _resources_list.find(_resource.Name); + if (iter != _resources_list.end()) + RES_INFOS("Warning resource " << _resource.Name << " already added, keep last resource found !"); _resources_list[_resource.Name] = _resource; } } @@ -138,6 +141,9 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) _resource.Clear(); if(ProcessCluster(aCurNode, _resource)) { + map::const_iterator iter = _resources_list.find(_resource.Name); + if (iter != _resources_list.end()) + RES_INFOS("Warning resource " << _resource.Name << " already added, keep last resource found !"); _resources_list[_resource.Name] = _resource; } } -- 2.39.2