airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [3/3] airavata-php-gateway git commit: AIRAVATA-2200 Check useUserCRPref when cloning
Date Fri, 04 Nov 2016 21:09:25 GMT
AIRAVATA-2200 Check useUserCRPref when cloning

Uncheck useUserCRPref if cloned by user who doesn't have user compute
resource preference for that compute resource.


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/5f6e8e44
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/5f6e8e44
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/5f6e8e44

Branch: refs/heads/develop
Commit: 5f6e8e445819b6c9198b59ae34e3b5d71d1c22dd
Parents: 291f3b5
Author: Marcus Christie <machrist@iu.edu>
Authored: Fri Nov 4 16:48:54 2016 -0400
Committer: Marcus Christie <machrist@iu.edu>
Committed: Fri Nov 4 16:48:54 2016 -0400

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


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5f6e8e44/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index aadfcf6..0f7a935 100755
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -636,6 +636,14 @@ class ExperimentUtilities
                 }
             }
             $experiment->userConfigurationData->experimentDataDir = ExperimentUtilities::$experimentPath;
+            $computeResourceId = $experiment->userConfigurationData->computationalResourceScheduling->resourceHostId;
+            if ($experiment->userConfigurationData->useUserCRPref){
+                // Check if this user has a user CR preference for the compute
+                // resource, if not we want to switch this flag to false
+                $userComputeResourcePreferences = URPUtilities::get_all_user_compute_resource_prefs();
+                $userHasComputeResourcePreference = array_key_exists($computeResourceId,
$userComputeResourcePreferences);
+                $experiment->userConfigurationData->useUserCRPref = $userHasComputeResourcePreference;
+            }
             Airavata::updateExperiment(Session::get('authz-token'), $cloneId, $experiment);
 
             $share = SharingUtilities::getAllUserPermissions($expId, ResourceType::EXPERIMENT);


Mime
View raw message