Skip to content

Commit d772f24

Browse files
fix: when sudo enable is false, execute command will failed (#13860)
1 parent 7e3ecfa commit d772f24

File tree

1 file changed

+1
-1
lines changed
  • dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils

1 file changed

+1
-1
lines changed

dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils/OSUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private OSUtils() {
3939
* @return result of sudo execute command
4040
*/
4141
public static String getSudoCmd(String tenantCode, String command) {
42-
return StringUtils.isEmpty(tenantCode) ? command : "sudo -u " + tenantCode + " " + command;
42+
return StringUtils.isEmpty(tenantCode) || !isSudoEnable() ? command : "sudo -u " + tenantCode + " " + command;
4343
}
4444

4545
/**

0 commit comments

Comments
 (0)