mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
VMware import - logs sanitation (#10433)
This commit is contained in:
parent
005afde24e
commit
f199783c75
@ -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;
|
||||
|
||||
@ -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;
|
||||
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(command[i]).append(" ");
|
||||
builder.append("vi://").append("******").append(" ");
|
||||
}
|
||||
|
||||
if ("-y".equals(cmd) || "-z".equals(cmd)) {
|
||||
obscureParam = true;
|
||||
_passwordCommand = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user