Browse Source

resolve shell task build command nullpointexception (#2267)

Co-authored-by: sunchaohe <sunzhaohe@linklogis.com>
pull/2/head
孙朝和 5 years ago committed by GitHub
parent
commit
d8cba5ff1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/shell/ShellTask.java

9
dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/shell/ShellTask.java

@ -134,7 +134,6 @@ public class ShellTask extends AbstractTask {
String script = shellParameters.getRawScript().replaceAll("\\r\\n", "\n"); String script = shellParameters.getRawScript().replaceAll("\\r\\n", "\n");
/** /**
* combining local and global parameters * combining local and global parameters
*/ */
@ -143,13 +142,9 @@ public class ShellTask extends AbstractTask {
shellParameters.getLocalParametersMap(), shellParameters.getLocalParametersMap(),
taskProps.getCmdTypeIfComplement(), taskProps.getCmdTypeIfComplement(),
taskProps.getScheduleTime()); taskProps.getScheduleTime());
// if (paramsMap != null){
// script = ParameterUtils.convertParameterPlaceholders(script, ParamUtils.convert(paramsMap));
// }
//new
// replace variable TIME with $[YYYYmmddd...] in shell file when history run job and batch complement job // replace variable TIME with $[YYYYmmddd...] in shell file when history run job and batch complement job
if (paramsMap != null) { if(paramsMap != null && taskProps.getScheduleTime()!=null) {
String dateTime = DateUtils.format(taskProps.getScheduleTime(), Constants.PARAMETER_FORMAT_TIME); String dateTime = DateUtils.format(taskProps.getScheduleTime(), Constants.PARAMETER_FORMAT_TIME);
Property p = new Property(); Property p = new Property();
p.setValue(dateTime); p.setValue(dateTime);
@ -182,6 +177,4 @@ public class ShellTask extends AbstractTask {
return shellParameters; return shellParameters;
} }
} }

Loading…
Cancel
Save