Salome HOME
CCAR:
authorcaremoli <caremoli>
Tue, 14 Apr 2009 15:15:16 +0000 (15:15 +0000)
committercaremoli <caremoli>
Tue, 14 Apr 2009 15:15:16 +0000 (15:15 +0000)
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
bin/runSalome.py
src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx
src/SALOMEDS/SALOMEDS_Study_i.cxx

index dd5258e4fe2ffb3598d9106404acff2933c22503..53034f950c452744a180031c1431e35a3a2a5812 100755 (executable)
@@ -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
index bf9cfc5fe7d5fba2c0889ebbebaa2d1bf2ddb52c..f5b95927f250134fbc056d59b2bc2318c0450518 100755 (executable)
@@ -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
index 3f80d74531fff880a450a6a0dd9e0083419cab8c..dee3b3109ce5d3857d65c2478a86ec9305fcd5ed 100644 (file)
@@ -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 "";
        }
     }
index 43ce2d59b7fb3d8b43f5ef630bb558c371149bcb..3ec35db2baa21a109202a585ec622b539ed92820 100644 (file)
@@ -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*/ }
     }
   }