VMware import - logs sanitation (#10433)

This commit is contained in:
Suresh Kumar Anaparti 2025-05-16 12:51:19 +05:30 committed by GitHub
parent 005afde24e
commit f199783c75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 19 deletions

View File

@ -57,7 +57,6 @@ public class LibvirtConvertInstanceCommandWrapper extends CommandWrapper<Convert
RemoteInstanceTO sourceInstance = cmd.getSourceInstance();
Hypervisor.HypervisorType sourceHypervisorType = sourceInstance.getHypervisorType();
String sourceInstanceName = sourceInstance.getInstanceName();
String sourceInstancePath = sourceInstance.getInstancePath();
Hypervisor.HypervisorType destinationHypervisorType = cmd.getDestinationHypervisorType();
DataStoreTO conversionTemporaryLocation = cmd.getConversionTemporaryLocation();
long timeout = (long) cmd.getWait() * 1000;

View File

@ -48,6 +48,7 @@ import org.joda.time.Duration;
import com.cloud.utils.Pair;
import com.cloud.utils.PropertiesUtil;
import com.cloud.utils.StringUtils;
import com.cloud.utils.concurrency.NamedThreadFactory;
import com.cloud.utils.script.OutputInterpreter.TimedOutLogger;
@ -155,25 +156,15 @@ public class Script implements Callable<String> {
boolean obscureParam = false;
for (int i = 0; i < command.length; i++) {
String cmd = command[i];
if (obscureParam) {
builder.append("******").append(" ");
obscureParam = false;
} else {
builder.append(command[i]).append(" ");
if (StringUtils.isNotEmpty(cmd) && cmd.startsWith("vi://")) {
String[] tokens = cmd.split("@");
if (tokens.length >= 2) {
builder.append("vi://").append("******@").append(tokens[1]).append(" ");
} else {
builder.append("vi://").append("******").append(" ");
}
continue;
}
if ("-y".equals(cmd) || "-z".equals(cmd)) {
obscureParam = true;
_passwordCommand = true;
}
}
return builder.toString();
}
protected String buildCommandLine(List<String> command) {
StringBuilder builder = new StringBuilder();
boolean obscureParam = false;
for (String cmd : command) {
if (obscureParam) {
builder.append("******").append(" ");
obscureParam = false;