mirror of
https://github.com/democratic-csi/democratic-csi.git
synced 2026-10-18 07:59:51 +02:00
Merge pull request #196 from jodlajodla/next
Apply sudo only to targetcli bin, not entire command
This commit is contained in:
@@ -476,19 +476,19 @@ delete ${iscsiName}
|
||||
|
||||
let command = "sh";
|
||||
let args = ["-c"];
|
||||
let taregetCliCommand = [];
|
||||
taregetCliCommand.push(`echo "${data}"`.trim());
|
||||
taregetCliCommand.push("|");
|
||||
taregetCliCommand.push("targetcli");
|
||||
|
||||
let targetCliArgs = ["targetcli"];
|
||||
if (
|
||||
_.get(this.options, "iscsi.shareStrategyTargetCli.sudoEnabled", false)
|
||||
) {
|
||||
command = "sudo";
|
||||
args.unshift("sh");
|
||||
targetCliArgs.unshift("sudo");
|
||||
}
|
||||
|
||||
args.push("'" + taregetCliCommand.join(" ") + "'");
|
||||
let targetCliCommand = [];
|
||||
targetCliCommand.push(`echo "${data}"`.trim());
|
||||
targetCliCommand.push("|");
|
||||
targetCliCommand.push(targetCliArgs.join(" "));
|
||||
args.push("'" + targetCliCommand.join(" ") + "'");
|
||||
|
||||
let logCommandTmp = command + " " + args.join(" ");
|
||||
let logCommand = "";
|
||||
|
||||
Reference in New Issue
Block a user