airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject airavata-php-gateway git commit: fixing AIRAVATA-1957 : When experiments are cloned there are two data directories getting created in the Storage
Date Wed, 23 Nov 2016 17:12:49 GMT
Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop dc8f8287d -> 1ce03109d


fixing AIRAVATA-1957 : When experiments are cloned there are two data directories getting
created in the Storage


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/1ce03109
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/1ce03109
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/1ce03109

Branch: refs/heads/develop
Commit: 1ce03109d1eae2822ad9ec2846e9a33badfaeca4
Parents: dc8f828
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Wed Nov 23 12:12:45 2016 -0500
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Wed Nov 23 12:12:45 2016 -0500

----------------------------------------------------------------------
 app/libraries/ExperimentUtilities.php | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/1ce03109/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index fdaa434..7604624 100755
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -288,14 +288,12 @@ class ExperimentUtilities
             $userConfigData->userDN = $_POST["userDN"];
         }
         $userConfigData->useUserCRPref = isset($_POST['use-user-cr-pref']) ? true : false;
-
+        ExperimentUtilities::create_experiment_folder_path($_POST['project'], $_POST['experiment-name']);
+        $userConfigData->experimentDataDir = ExperimentUtilities::$experimentPath;
         $applicationInputs = AppUtilities::get_application_inputs($_POST['application']);
-        $experimentInputs = ExperimentUtilities::process_inputs($_POST['project'], $_POST['experiment-name'],
$applicationInputs, $experimentInputs);
+        $experimentInputs = ExperimentUtilities::process_inputs(ExperimentUtilities::$experimentPath,
$applicationInputs, $experimentInputs);
+
 
-        if (ExperimentUtilities::$experimentPath == null) {
-            ExperimentUtilities::create_experiment_folder_path($_POST['project'], $_POST['experiment-name']);
-        }
-        $userConfigData->experimentDataDir = ExperimentUtilities::$experimentPath;
 
         $experiment = new ExperimentModel();
         // required
@@ -330,13 +328,11 @@ class ExperimentUtilities
      * @internal param $environmentPath
      * @return array
      */
-    public static function process_inputs($projectId, $experimentName, $applicationInputs,
$experimentInputs)
+    public static function process_inputs($experimentFilePath, $applicationInputs, $experimentInputs)
     {
         $experimentAssemblySuccessful = true;
         $newExperimentInputs = array();
 
-        ExperimentUtilities::create_experiment_folder_path($projectId, $experimentName);
-
         //sending application inputs in the order defined by the admins.
         $order = array();
         foreach ($applicationInputs as $index => $input) {
@@ -378,9 +374,9 @@ class ExperimentUtilities
                     // move file to experiment data directory
                     //
                     if (!empty($applicationInput->value)) {
-                        $filePath = ExperimentUtilities::$experimentPath . $applicationInput->value;
+                        $filePath = $experimentFilePath . $applicationInput->value;
                     } else {
-                        $filePath = ExperimentUtilities::$experimentPath . $file['name'];
+                        $filePath = $experimentFilePath . $file['name'];
                     }
 
                     // check if file already exists
@@ -1281,7 +1277,7 @@ class ExperimentUtilities
         $applicationInputs = AppUtilities::get_application_inputs($experiment->executionId);
 
         $experimentInputs = $experiment->experimentInputs; // get current inputs
-        $experimentInputs = ExperimentUtilities::process_inputs( $experiment->projectId,
$input['experiment-name'], $applicationInputs, $experimentInputs); // get new inputs
+        $experimentInputs = ExperimentUtilities::process_inputs( $experiment->userConfigurationData->experimentDataDir,
$applicationInputs, $experimentInputs); // get new inputs
 
         if ($experimentInputs) {
             $experiment->experimentInputs = $experimentInputs;


Mime
View raw message