Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private OutOfBandManagementDriverResponse execute(final OutOfBandManagementDrive

final OutOfBandManagementDriverResponse response = IPMITOOL.executeCommands(ipmiToolCommands, cmd.getTimeout());

String oneLineCommand = StringUtils.join(IPMITOOL.getSanatisedCommandStrings(ipmiToolCommands), " ");
String oneLineCommand = StringUtils.join(IPMITOOL.getSanitisedCommandStrings(ipmiToolCommands), " ");
String result = response.getResult().trim();

if (response.isSuccess()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public OutOfBandManagementDriverResponse executeCommands(final List<String> comm
public OutOfBandManagementDriverResponse executeCommands(final List<String> commands, final Duration timeOut) {
final ProcessResult result = RUNNER.executeCommands(commands, timeOut);
if (logger.isTraceEnabled()) {
List<String> cleanedCommands = getSanatisedCommandStrings(commands);
List<String> cleanedCommands = getSanitisedCommandStrings(commands);
logger.trace("Executed ipmitool process with commands: {}\nIpmitool execution standard output: {}\nIpmitool execution error output: {}",
StringUtils.join(cleanedCommands, ", "),
result.getStdOutput(),
Expand All @@ -167,7 +167,7 @@ public OutOfBandManagementDriverResponse executeCommands(final List<String> comm
return new OutOfBandManagementDriverResponse(result.getStdOutput(), result.getStdError(), result.isSuccess());
}

List<String> getSanatisedCommandStrings(List<String> commands) {
List<String> getSanitisedCommandStrings(List<String> commands) {
List<String> cleanedCommands = new ArrayList<>();
int maskNextCommand = 0;
for (String command : commands) {
Expand All @@ -176,7 +176,7 @@ List<String> getSanatisedCommandStrings(List<String> commands) {
maskNextCommand--;
continue;
}
if (command.equalsIgnoreCase("-P")) {
if (command.equals("-P")) {
maskNextCommand = 1;
} else if (command.toLowerCase().endsWith("password")) {
maskNextCommand = 2;
Expand Down
Loading