From a39136ff085a61d9d9531e8ce7fe355fc5d138d3 Mon Sep 17 00:00:00 2001 From: caremoli Date: Tue, 14 Apr 2009 15:15:16 +0000 Subject: [PATCH] CCAR: 1- execute python script files (runSalome -u) in globals and not in globals,locals as it was done before 2- don't use obsolete omniORB initref form in runRemote.sh 3- put _narrow (SALOMEDS_Study_i.cxx) into a try catch : _narrow can throw CORBA::Exception --- bin/appliskel/runRemote.sh | 2 +- bin/runSalome.py | 3 +-- .../SALOME_FileTransferCORBA.cxx | 5 ++-- src/SALOMEDS/SALOMEDS_Study_i.cxx | 27 ++++++++++++------- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/bin/appliskel/runRemote.sh b/bin/appliskel/runRemote.sh index dd5258e4f..53034f950 100755 --- a/bin/appliskel/runRemote.sh +++ b/bin/appliskel/runRemote.sh @@ -57,7 +57,7 @@ export NSHOST NSPORT=$2 export NSPORT initref="NameService=corbaname::"$1":$2" -echo "ORBInitRef $initref" > $OMNIORB_CONFIG +echo "InitRef = $initref" > $OMNIORB_CONFIG #go to the requested working directory if any if test "x$3" == "xWORKINGDIR"; then diff --git a/bin/runSalome.py b/bin/runSalome.py index bf9cfc5fe..f5b95927f 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -705,8 +705,7 @@ def useSalome(args, modules_list, modules_root_dir): scrname = toimport[ i ] if len(scrname) > 2 and (len(scrname) - string.rfind(scrname, ".py") == 3): print 'executing',scrname - doexec = 'execfile(\"%s\")'%scrname - exec doexec + execfile(scrname,globals()) else: print 'importing',scrname doimport = 'import ' + scrname diff --git a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx index 3f80d7453..dee3b3109 100644 --- a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx @@ -134,8 +134,7 @@ string SALOME_FileTransferCORBA::getLocalFile(string localFile) Engines::MachineList_var listOfMachines = resManager->GetFittingResources(params, clist); - container = contManager->FindOrStartContainer(params, - listOfMachines); + container = contManager->FindOrStartContainer(params, listOfMachines); if (CORBA::is_nil(container)) { INFOS("machine " << _refMachine << " unreachable"); @@ -145,7 +144,7 @@ string SALOME_FileTransferCORBA::getLocalFile(string localFile) _theFileRef = container->createFileRef(_origFileName.c_str()); if (CORBA::is_nil(_theFileRef)) { - INFOS("imposssible to create fileRef on " << _refMachine); + INFOS("impossible to create fileRef on " << _refMachine); return ""; } } diff --git a/src/SALOMEDS/SALOMEDS_Study_i.cxx b/src/SALOMEDS/SALOMEDS_Study_i.cxx index 43ce2d59b..3ec35db2b 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.cxx @@ -667,16 +667,23 @@ void SALOMEDS_Study_i::Close() if (sco->ComponentIOR(IOREngine)) { // we have found the associated engine to write the data MESSAGE ( "We have found an engine for data type :"<< sco->ComponentDataType()); - CORBA::Object_var obj = _orb->string_to_object(IOREngine); - if (!CORBA::is_nil(obj)) { - SALOMEDS::Driver_var anEngine = SALOMEDS::Driver::_narrow(obj) ; - - if (!anEngine->_is_nil()) { - SALOMEDS::unlock(); - anEngine->Close(sco); - SALOMEDS::lock(); - } - } + //_narrow can throw a corba exception + try + { + CORBA::Object_var obj = _orb->string_to_object(IOREngine); + if (!CORBA::is_nil(obj)) + { + SALOMEDS::Driver_var anEngine = SALOMEDS::Driver::_narrow(obj) ; + if (!anEngine->_is_nil()) + { + SALOMEDS::unlock(); + anEngine->Close(sco); + SALOMEDS::lock(); + } + } + } + catch (CORBA::Exception&) + {/*pass*/ } } } -- 2.39.2