Skip to content

Commit

Permalink
Add requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zguesmi committed May 17, 2021
1 parent e7ead64 commit e73ec20
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/main/java/com/iexec/common/task/TaskDescription.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public class TaskDescription {
*/
public boolean containsDataset() {
return !StringUtils.isEmpty(datasetAddress) &&
!datasetAddress.equals(BytesUtils.EMPTY_ADDRESS) &&
!StringUtils.isEmpty(datasetUri) &&
!StringUtils.isEmpty(datasetChecksum) &&
!StringUtils.isEmpty(datasetName);
Expand All @@ -84,7 +85,7 @@ public boolean containsDataset() {
* @return true if a callback address is found in the deal, false otherwise.
*/
public boolean containsCallback() {
return getCallback() != null &&
return StringUtils.isEmpty(getCallback()) &&
!getCallback().equals(BytesUtils.EMPTY_ADDRESS);
}

Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/iexec/common/utils/IexecEnvUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,19 @@ private IexecEnvUtils() {
* @return
*/
public static Map<String, String> getAllIexecEnv(TaskDescription taskDescription) {
Map<String, String> map = new HashMap<>();
map.putAll(getComputeStageEnvMap(taskDescription));
map.put(IEXEC_DATASET_URL, taskDescription.getDatasetUri());
map.put(IEXEC_DATASET_CHECKSUM, taskDescription.getDatasetChecksum());
Map<String, String> envMap = new HashMap<>();
envMap.putAll(getComputeStageEnvMap(taskDescription));
envMap.put(IEXEC_DATASET_URL, taskDescription.getDatasetUri());
envMap.put(IEXEC_DATASET_CHECKSUM, taskDescription.getDatasetChecksum());
if (taskDescription.getInputFiles() == null) {
return map;
return envMap;
}
int index = 1;
for (String inputFileUrl : taskDescription.getInputFiles()) {
map.put(IEXEC_INPUT_FILE_URL_PREFIX + index, inputFileUrl);
envMap.put(IEXEC_INPUT_FILE_URL_PREFIX + index, inputFileUrl);
index++;
}
return map;
return envMap;
}

/**
Expand Down

0 comments on commit e73ec20

Please sign in to comment.