fix: when sudo enable is false, execute command will failed (#13860)
This commit is contained in:
parent
298091bf3b
commit
0df149c370
|
|
@ -39,7 +39,7 @@ public class OSUtils {
|
|||
* @return result of sudo execute command
|
||||
*/
|
||||
public static String getSudoCmd(String tenantCode, String command) {
|
||||
return StringUtils.isEmpty(tenantCode) ? command : "sudo -u " + tenantCode + " " + command;
|
||||
return StringUtils.isEmpty(tenantCode) || !isSudoEnable() ? command : "sudo -u " + tenantCode + " " + command;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue