From 156a5b023826ac40260bf2b45aeef96d80f3bd7a Mon Sep 17 00:00:00 2001 From: rahuel Date: Tue, 2 Mar 2004 16:17:34 +0000 Subject: [PATCH] *** empty log message *** --- src/ContainersManager/ContainersManager_i.cxx | 139 ++++++++++-------- .../TestContainersManager.py | 9 ++ 2 files changed, 85 insertions(+), 63 deletions(-) diff --git a/src/ContainersManager/ContainersManager_i.cxx b/src/ContainersManager/ContainersManager_i.cxx index b3a8414e6..1502f1388 100644 --- a/src/ContainersManager/ContainersManager_i.cxx +++ b/src/ContainersManager/ContainersManager_i.cxx @@ -376,84 +376,97 @@ Engines::Container_ptr Manager_i::StartContainer( const Containers::MachineParam << MyParams.NsHostName << " " << MyParams.NsPort << " " << _ListOfContainers->length() << " computers" ) ; _ResourcesComputer = _ResourcesManager->SearchComputer( MyParams.HostName ) ; - if ( CORBA::is_nil( _EnginesContainer ) && !CORBA::is_nil( _ResourcesComputer ) ) { - Resources::ComputerEnvironment * aComputerEnvironment = _ResourcesComputer->Environment() ; + if ( CORBA::is_nil( _EnginesContainer ) ) { + Resources::ComputerEnvironment * aComputerEnvironment = NULL ; + if ( !CORBA::is_nil( _ResourcesComputer ) ) { + aComputerEnvironment = _ResourcesComputer->Environment() ; + } string rsh( "" ) ; char * HostName = MyParams.HostName ; if ( strcmp( HostName , GetHostname().c_str() ) ) { - if ( _ResourcesManager->SshAccess( HostName ) ) { + if ( aComputerEnvironment == NULL || _ResourcesManager->SshAccess( HostName ) ) { rsh += "ssh " ; } else { rsh += "rsh -n " ; } + if ( !CORBA::is_nil( _ResourcesComputer ) ) { + string aUserName = _ResourcesManager->UserName( HostName ) ; + if ( strlen( aUserName ) ) { + rsh += "-l " ; + rsh += aUserName ; + rsh += " " ; + } + } rsh += MyParams.HostName ; rsh += " sh -c \"'" ; - int size = aComputerEnvironment->Module_Root_Dir_Names.length() ; - int i ; - bool GeomModule = false ; - for ( i = 0 ; i < size ; i++ ) { - if ( i > 0 ) { + if ( aComputerEnvironment != NULL ) { + int size = aComputerEnvironment->Module_Root_Dir_Names.length() ; + int i ; + bool GeomModule = false ; + for ( i = 0 ; i < size ; i++ ) { + if ( i > 0 ) { + rsh += " ; " ; + } + rsh += aComputerEnvironment->Module_Root_Dir_Names[ i ] ; + if ( strcmp( aComputerEnvironment->Module_Root_Dir_Names[ i ] , "GEOM_ROOT_DIR" ) == 0 ) { + GeomModule = true ; + } + rsh += "=" ; + rsh += aComputerEnvironment->Module_Root_Dir_Values[ i ] ; + rsh += " ; export " ; + rsh += aComputerEnvironment->Module_Root_Dir_Names[ i ] ; + } + if ( size > 0 ) { rsh += " ; " ; } - rsh += aComputerEnvironment->Module_Root_Dir_Names[ i ] ; - if ( strcmp( aComputerEnvironment->Module_Root_Dir_Names[ i ] , "GEOM_ROOT_DIR" ) == 0 ) { - GeomModule = true ; + rsh += "PATH=" ; + int j ; + string Path = (char * ) aComputerEnvironment->Path ; + for ( j = 0 ; j < Path.size() ; j++ ) { + if ( Path[ j ] == '$' ) { + rsh += "\\" ; + } + rsh += Path[ j ] ; } - rsh += "=" ; - rsh += aComputerEnvironment->Module_Root_Dir_Values[ i ] ; - rsh += " ; export " ; - rsh += aComputerEnvironment->Module_Root_Dir_Names[ i ] ; - } - if ( size > 0 ) { - rsh += " ; " ; - } - rsh += "PATH=" ; - int j ; - string Path = (char * ) aComputerEnvironment->Path ; - for ( j = 0 ; j < Path.size() ; j++ ) { - if ( Path[ j ] == '$' ) { - rsh += "\\" ; - } - rsh += Path[ j ] ; - } - rsh += " ; export PATH" ; - rsh += " ; LD_LIBRARY_PATH=" ; - string Ld_Library_Path = (char * ) aComputerEnvironment->Ld_Library_Path ; - for ( j = 0 ; j < Ld_Library_Path.size() ; j++ ) { - if ( Ld_Library_Path[ j ] == '$' ) { - rsh += "\\" ; - } - rsh += Ld_Library_Path[ j ] ; - } - rsh += " ; export LD_LIBRARY_PATH" ; - rsh += " ; PYTHONPATH=" ; - string PythonPath = (char * ) aComputerEnvironment->PythonPath ; - for ( j = 0 ; j < PythonPath.size() ; j++ ) { - if ( PythonPath[ j ] == '$' ) { - rsh += "\\" ; - } - rsh += PythonPath[ j ] ; - } - rsh += " ; export PYTHONPATH" ; - rsh += " ; CASROOT=" ; - rsh += aComputerEnvironment->CasRoot ; - rsh += " ; export CASROOT" ; - rsh += " ; CSF_PluginDefaults=" ; - rsh += "\\" ; - rsh += "${KERNEL_ROOT_DIR}/share/salome/resources" ; - rsh += " ; export CSF_PluginDefaults" ; - rsh += " ; CSF_SALOMEDS_ResourcesDefaults=" ; - rsh += "\\" ; - rsh += "${KERNEL_ROOT_DIR}/share/salome/resources" ; - rsh += " ; export CSF_SALOMEDS_ResourcesDefaults" ; - if ( GeomModule ) { - rsh += " ; CSF_GEOMDS_ResourcesDefaults=" ; + rsh += " ; export PATH" ; + rsh += " ; LD_LIBRARY_PATH=" ; + string Ld_Library_Path = (char * ) aComputerEnvironment->Ld_Library_Path ; + for ( j = 0 ; j < Ld_Library_Path.size() ; j++ ) { + if ( Ld_Library_Path[ j ] == '$' ) { + rsh += "\\" ; + } + rsh += Ld_Library_Path[ j ] ; + } + rsh += " ; export LD_LIBRARY_PATH" ; + rsh += " ; PYTHONPATH=" ; + string PythonPath = (char * ) aComputerEnvironment->PythonPath ; + for ( j = 0 ; j < PythonPath.size() ; j++ ) { + if ( PythonPath[ j ] == '$' ) { + rsh += "\\" ; + } + rsh += PythonPath[ j ] ; + } + rsh += " ; export PYTHONPATH" ; + rsh += " ; CASROOT=" ; + rsh += aComputerEnvironment->CasRoot ; + rsh += " ; export CASROOT" ; + rsh += " ; CSF_PluginDefaults=" ; + rsh += "\\" ; + rsh += "${KERNEL_ROOT_DIR}/share/salome/resources" ; + rsh += " ; export CSF_PluginDefaults" ; + rsh += " ; CSF_SALOMEDS_ResourcesDefaults=" ; rsh += "\\" ; - rsh += "${GEOM_ROOT_DIR}/share/salome/resources" ; - rsh += " ; export CSF_GEOMDS_ResourcesDefaults" ; + rsh += "${KERNEL_ROOT_DIR}/share/salome/resources" ; + rsh += " ; export CSF_SALOMEDS_ResourcesDefaults" ; + if ( GeomModule ) { + rsh += " ; CSF_GEOMDS_ResourcesDefaults=" ; + rsh += "\\" ; + rsh += "${GEOM_ROOT_DIR}/share/salome/resources" ; + rsh += " ; export CSF_GEOMDS_ResourcesDefaults" ; + } + rsh += " ; " ; } - rsh += " ; " ; } if ( MyParams.ContainerType == Engines::Cpp || MyParams.ContainerType == Engines::Undefined ) { rsh += "SALOME_Container " ; diff --git a/src/ContainersManager/TestContainersManager.py b/src/ContainersManager/TestContainersManager.py index 4c8eee538..16569773a 100644 --- a/src/ContainersManager/TestContainersManager.py +++ b/src/ContainersManager/TestContainersManager.py @@ -281,6 +281,11 @@ while i < len( ListOfComponents ) : print ListOfComponents[ i ].GetContainerRef()._get_name(),ListOfComponents[ i ]._get_instanceName(),ListOfComponents[ i ]._get_interfaceName() i = i + 1 + + + + + from LifeCycleCORBA import * orb = CORBA.ORB_init([''], CORBA.ORB_ID) lcc = LifeCycleCORBA( orb ) @@ -344,3 +349,7 @@ DefaultParams.HostName = 'bojolex' lccbojolexMulComponent = lcc.FindOrLoadComponent( DefaultParams , "MulComponent" ) +DefaultParams.HostName = 'toto' + +lcctotoMulComponent = lcc.FindOrLoadComponent( DefaultParams , "MulComponent" ) + -- 2.39.2