From 5eca1785d9f71d6cbe88fa06fc761262a34c6106 Mon Sep 17 00:00:00 2001 From: caremoli Date: Fri, 18 Jan 2008 11:16:59 +0000 Subject: [PATCH] CCAR: add localhost in default CatalogResources.xml catalog --- bin/appli_gen.py | 10 +++ resources/CatalogResources.xml.in | 41 +----------- src/Container/SALOME_ContainerManager.cxx | 4 ++ .../SALOME_ResourcesCatalog_Handler.cxx | 66 +++++++++++-------- 4 files changed, 53 insertions(+), 68 deletions(-) diff --git a/bin/appli_gen.py b/bin/appli_gen.py index 89e30a94e..c24614cc1 100644 --- a/bin/appli_gen.py +++ b/bin/appli_gen.py @@ -224,6 +224,16 @@ def install(prefix,config_file): +""" + f.write(command) + f.close() + + #Add default CatalogResources.xml file + f =open(os.path.join(home_dir,'CatalogResources.xml'),'w') + command=""" + + + """ f.write(command) f.close() diff --git a/resources/CatalogResources.xml.in b/resources/CatalogResources.xml.in index 874d32492..11e6b6e26 100644 --- a/resources/CatalogResources.xml.in +++ b/resources/CatalogResources.xml.in @@ -1,43 +1,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 679dc1906..72a2b7345 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -230,6 +230,10 @@ StartContainer(const Engines::MachineParameters& params, return Engines::Container::_nil(); } + //If the machine name is localhost use the real name + if(theMachine == "localhost") + theMachine=GetHostname(); + MESSAGE("try to launch it on " << theMachine); // Get Id for container: a parallel container registers in Naming Service diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx index 58eb63d01..0b85c6bfb 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx @@ -137,37 +137,47 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) else _resource.Alias = ""; - xmlChar* protocol= xmlGetProp(aCurNode, (const xmlChar*)test_protocol); - switch ( protocol[0]) - { - case 'r': - _resource.Protocol = rsh; - break; - case 's': - _resource.Protocol = ssh; - break; - default: - // If it'not in all theses cases, the protocol is affected to rsh - _resource.Protocol = rsh; - break; - } - xmlFree(protocol); + if (xmlHasProp(aCurNode, (const xmlChar*)test_protocol)) + { + xmlChar* protocol= xmlGetProp(aCurNode, (const xmlChar*)test_protocol); + switch ( protocol[0]) + { + case 'r': + _resource.Protocol = rsh; + break; + case 's': + _resource.Protocol = ssh; + break; + default: + // If it'not in all theses cases, the protocol is affected to rsh + _resource.Protocol = rsh; + break; + } + xmlFree(protocol); + } + else + _resource.Protocol = rsh; - xmlChar* mode=xmlGetProp(aCurNode, (const xmlChar*)test_mode); - switch ( mode[0] ) + if (xmlHasProp(aCurNode, (const xmlChar*)test_mode)) { - case 'i': - _resource.Mode = interactive; - break; - case 'b': - _resource.Mode = batch; - break; - default: - // If it'not in all theses cases, the mode is affected to interactive - _resource.Mode = interactive; - break; + xmlChar* mode=xmlGetProp(aCurNode, (const xmlChar*)test_mode); + switch ( mode[0] ) + { + case 'i': + _resource.Mode = interactive; + break; + case 'b': + _resource.Mode = batch; + break; + default: + // If it'not in all theses cases, the mode is affected to interactive + _resource.Mode = interactive; + break; + } + xmlFree(mode); } - xmlFree(mode); + else + _resource.Mode = interactive; if (xmlHasProp(aCurNode, (const xmlChar*)test_batch)) { -- 2.39.2