]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Integrate patch from EDF for resources manager V5_1_3 V5_1_3_patch01 V5_1_3rc4 V5_1_3rc5
authorvsr <vsr@opencascade.com>
Wed, 25 Nov 2009 13:17:10 +0000 (13:17 +0000)
committervsr <vsr@opencascade.com>
Wed, 25 Nov 2009 13:17:10 +0000 (13:17 +0000)
src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx

index 4234cda85e3162dacf7a25ce2f6c9518aac7d22f..d4f5d269b5284e2aef6e7193236d5c2d5276f543 100755 (executable)
@@ -144,13 +144,14 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
          else
          {
            // Adding a machine
-           _resources_list[_resource.HostName] = _resource;
-           if(_resource.HostName == "localhost")
-           {
-             _resource.HostName = Kernel_Utils::GetHostname();
-             _resource.DataForSort._hostName = Kernel_Utils::GetHostname();
-             _resources_list[Kernel_Utils::GetHostname()] = _resource;
-           }
+        if(_resource.HostName == "localhost")
+          {
+            _resource.HostName = Kernel_Utils::GetHostname();
+            _resource.DataForSort._hostName = Kernel_Utils::GetHostname();
+            _resources_list[Kernel_Utils::GetHostname()] = _resource;
+          }
+        else
+          _resources_list[_resource.HostName] = _resource;
          }
        }
        else
@@ -555,6 +556,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser
   xmlNodePtr aCurSubNode = machine_descr->xmlChildrenNode;
   while(aCurSubNode != NULL)
   {
+    // Process components
     if ( !xmlStrcmp(aCurSubNode->name, (const xmlChar*)test_components) )
     {
       //If a component is given, it is in a module with the same name
@@ -577,14 +579,17 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser
       }
     }
     // Process modules
-    if ( !xmlStrcmp(aCurSubNode->name, (const xmlChar*)test_modules) )
+    else if ( !xmlStrcmp(aCurSubNode->name, (const xmlChar*)test_modules) )
     {
+      // If a module is given, we create an entry in componentsList and modulesList
+      // with the same name (module == component)
       if (xmlHasProp(aCurSubNode, (const xmlChar*)test_module_name)) 
       {
-       xmlChar* module_name = xmlGetProp(aCurSubNode, (const xmlChar*)test_module_name);
-       std::string aModuleName = (const char*)module_name;
-       resource.ModulesList.push_back(aModuleName);
-       xmlFree(module_name);
+        xmlChar* component_name = xmlGetProp(aCurSubNode, (const xmlChar*)test_module_name);
+        std::string aComponentName = (const char*)component_name;
+        _resource.ComponentsList.push_back(aComponentName);
+        _resource.ModulesList.push_back(aComponentName);
+        xmlFree(component_name);
       }
     }
     aCurSubNode = aCurSubNode->next;