From a89e356321fab4307bc818e198ca0b9b3ca3a04c Mon Sep 17 00:00:00 2001 From: bri Date: Mon, 10 Feb 2014 18:12:01 +0400 Subject: [PATCH] Checked-out files path was changed to /tmp/SimanSalome/StudyId/ScenarioId/UserId --- scripts/run_salome_siman.sh | 32 ++++++++++++++++---------------- src/SimanIO_Link.cxx | 17 ++++++++++++++--- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/scripts/run_salome_siman.sh b/scripts/run_salome_siman.sh index e173628..fde597f 100644 --- a/scripts/run_salome_siman.sh +++ b/scripts/run_salome_siman.sh @@ -1,6 +1,6 @@ #!/bin/bash -echo "parameters : $1 $2 $3" > /home/siman/check_params.txt -echo "$#" >> /home/siman/check_params.txt +echo "parameters : $1 $2 $3" > check_params.txt +echo "$#" >> check_params.txt if [ "$#" -ne 3 ] ; then echo "Usage : @@ -14,18 +14,18 @@ fi #echo dir1 = `dirname $0` #echo dir2 = ${PWD} -echo "pwd = " ${PWD} >> /home/siman/check_params.txt -echo "display = " ${DISPLAY} >> /home/siman/check_params.txt +echo "pwd = " ${PWD} >> check_params.txt +echo "display = " ${DISPLAY} >> check_params.txt env_script=${PWD}/env_products.sh echo script = $env_script if [ -e $env_script ] ; then echo - echo ">>> Setting SALOME environment" >> /home/siman/check_params.txt - echo ">>> Environment script = " $env_script >> /home/siman/check_params.txt - source $env_script >> /home/siman/check_params.txt - echo ">>> After products " >> /home/siman/check_params.txt + echo ">>> Setting SALOME environment" >> check_params.txt + echo ">>> Environment script = " $env_script >> check_params.txt + source $env_script >> check_params.txt + echo ">>> After products " >> check_params.txt else echo echo '!!! Warning !!! Environment is not set.' @@ -33,28 +33,28 @@ if [ -e $env_script ] ; then echo 'Proceed with the current environment.' fi -echo ">>> Setting SALOME-SAMAN environment" >> /home/siman/check_params.txt +echo ">>> Setting SALOME-SAMAN environment" >> check_params.txt export WSFCPP_HOME=${PWD}/wso2-wsf-cpp-2.1.0 #export PATH=${WSFCPP_HOME}/lib:${PATH} export LD_LIBRARY_PATH=${WSFCPP_HOME}/lib:${LD_LIBRARY_PATH} -echo "WSFCPP_HOME = " ${WSFCPP_HOME} >> /home/siman/check_params.txt +echo "WSFCPP_HOME = " ${WSFCPP_HOME} >> check_params.txt export SIMANIO_ROOT_DIR=${PWD}/SIMANIO export PATH=${SIMANIO_ROOT_DIR}/lib:${PATH} export LD_LIBRARY_PATH=${SIMANIO_ROOT_DIR}/lib:${LD_LIBRARY_PATH} -export SIMAN_WS_HOST="172.22.2.65:8080" +export SIMAN_WS_HOST="127.0.0.1:8080" -export PYTHONPATH="/tmp/SimanSalome/${3##*=}/download":${PYTHONPATH} +export PYTHONPATH="/tmp/SimanSalome/${1##*=}/${2##*=}/${3##*=}":${PYTHONPATH} -echo "parameters 3: $1 $2 $3" >> /home/siman/check_params.txt +echo "parameters 3: $1 $2 $3" >> check_params.txt #export SALOME_ROOT_DIR=${PWD} -echo ">>> SALOME-SIMAN running" >> /home/siman/check_params.txt +echo ">>> SALOME-SIMAN running" >> check_params.txt -echo "parameters 4: $1 $2 $3" >> /home/siman/check_params.txt +echo "parameters 4: $1 $2 $3" >> check_params.txt -runSalome --siman $1 $2 $3 -k >> /home/siman/check_params.txt +runSalome --siman $1 $2 $3 -k >> check_params.txt diff --git a/src/SimanIO_Link.cxx b/src/SimanIO_Link.cxx index 7dada80..41f5df0 100644 --- a/src/SimanIO_Link.cxx +++ b/src/SimanIO_Link.cxx @@ -108,7 +108,8 @@ SimanIO_Configuration SimanIO_Link::RetrieveConf() //Parse the response and get the filename string aTmpDir = "/tmp"; - string aClientFileDir = aTmpDir + "/SimanSalome/" + myUser + "/download/"; + string aClientFileDir = aTmpDir + "/SimanSalome/" + myStudy + "/" + myScenario + "/" + myUser + "/"; + //string aClientFileDir = aTmpDir + "/SimanSalome/" + myUser + "/download/"; string aClientFilePath = aClientFileDir + aResponseFileName; //Cretae the directories @@ -184,6 +185,7 @@ SimanIO_Configuration SimanIO_Link::RetrieveConf() void SimanIO_Link::StoreConf(/*const*/ SimanIO_Configuration& theConf) { + cout << "StoreConf method is started\n"; char* aSimanHost = getenv("SIMAN_WS_HOST"); if (aSimanHost == NULL) { @@ -221,7 +223,8 @@ void SimanIO_Link::StoreConf(/*const*/ SimanIO_Configuration& theConf) //Prepare salome-siman.conf file string aTmpDir = "/tmp"; - string aClientFileDir = aTmpDir + "/SimanSalome/" + myUser + "/download/"; + string aClientFileDir = aTmpDir + "/SimanSalome/" + myStudy + "/" + myScenario + "/" + myUser + "/"; + //string aClientFileDir = aTmpDir + "/SimanSalome/" + myUser + "/download/"; string aClientFilePath = aClientFileDir + "salome-siman.conf"; ofstream aSalomeSimanFile; aSalomeSimanFile.open(aClientFilePath.c_str()); @@ -302,5 +305,13 @@ void SimanIO_Link::StoreConf(/*const*/ SimanIO_Configuration& theConf) aCheckInRequest->setArgs1(atoll(myUser.c_str())); aCheckInResponse = aStub->checkIn(aCheckInRequest); - + //Delete the directories + system(("rm -r " + aTmpDir + "/SimanSalome/").c_str()); + + //Delete objects + delete aPutFileRequest; + delete aPutFileResponse; + delete aCheckInRequest; + delete aCheckInResponse; + delete aStub; } -- 2.39.2