Use default key of user resource profile
When the user hasn't set a resource specific key for compute or storage
preference, use the default one on the user resource profile
@@ -447,28 +447,38 @@ public class ProcessContext {
}
public String getComputeResourceCredentialToken(){
- if (isUseUserCRPref() &&
- userComputeResourcePreference != null &&
+ if (isUseUserCRPref()) {
+ if (userComputeResourcePreference != null &&
isValid(userComputeResourcePreference.getResourceSpecificCredentialStoreToken())) {
return userComputeResourcePreference.getResourceSpecificCredentialStoreToken();
- } else if (isValid(gatewayComputeResourcePreference.getResourceSpecificCredentialStoreToken())) {
+ } else {
+ return userResourceProfile.getCredentialStoreToken();
+ }
+ } else {
+ if (isValid(gatewayComputeResourcePreference.getResourceSpecificCredentialStoreToken())) {
return gatewayComputeResourcePreference.getResourceSpecificCredentialStoreToken();
} else {
return gatewayResourceProfile.getCredentialStoreToken();
}
}
+ }
public String getStorageResourceCredentialToken(){
- if (isUseUserCRPref() &&
- userStoragePreference != null &&
+ if (isUseUserCRPref()) {
+ if (userStoragePreference != null &&
isValid(userStoragePreference.getResourceSpecificCredentialStoreToken())) {
return userStoragePreference.getResourceSpecificCredentialStoreToken();
- } else if (isValid(gatewayStorageResourcePreference.getResourceSpecificCredentialStoreToken())) {
+ } else {
+ return userResourceProfile.getCredentialStoreToken();
+ }
+ } else {
+ if (isValid(gatewayStorageResourcePreference.getResourceSpecificCredentialStoreToken())) {
return gatewayStorageResourcePreference.getResourceSpecificCredentialStoreToken();
} else {
return gatewayResourceProfile.getCredentialStoreToken();
}
}
+ }
public JobSubmissionProtocol getPreferredJobSubmissionProtocol(){
return gatewayComputeResourcePreference.getPreferredJobSubmissionProtocol();
