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();
|
RemoteInstanceTO sourceInstance = cmd.getSourceInstance();
|
||||||
Hypervisor.HypervisorType sourceHypervisorType = sourceInstance.getHypervisorType();
|
Hypervisor.HypervisorType sourceHypervisorType = sourceInstance.getHypervisorType();
|
||||||
String sourceInstanceName = sourceInstance.getInstanceName();
|
String sourceInstanceName = sourceInstance.getInstanceName();
|
||||||
String sourceInstancePath = sourceInstance.getInstancePath();
|
|
||||||
Hypervisor.HypervisorType destinationHypervisorType = cmd.getDestinationHypervisorType();
|
Hypervisor.HypervisorType destinationHypervisorType = cmd.getDestinationHypervisorType();
|
||||||
DataStoreTO conversionTemporaryLocation = cmd.getConversionTemporaryLocation();
|
DataStoreTO conversionTemporaryLocation = cmd.getConversionTemporaryLocation();
|
||||||
long timeout = (long) cmd.getWait() * 1000;
|
long timeout = (long) cmd.getWait() * 1000;
|
||||||
|
|||||||
@ -48,6 +48,7 @@ import org.joda.time.Duration;
|
|||||||
|
|
||||||
import com.cloud.utils.Pair;
|
import com.cloud.utils.Pair;
|
||||||
import com.cloud.utils.PropertiesUtil;
|
import com.cloud.utils.PropertiesUtil;
|
||||||
|
import com.cloud.utils.StringUtils;
|
||||||
import com.cloud.utils.concurrency.NamedThreadFactory;
|
import com.cloud.utils.concurrency.NamedThreadFactory;
|
||||||
import com.cloud.utils.script.OutputInterpreter.TimedOutLogger;
|
import com.cloud.utils.script.OutputInterpreter.TimedOutLogger;
|
||||||
|
|
||||||
@ -155,25 +156,15 @@ public class Script implements Callable<String> {
|
|||||||
boolean obscureParam = false;
|
boolean obscureParam = false;
|
||||||
for (int i = 0; i < command.length; i++) {
|
for (int i = 0; i < command.length; i++) {
|
||||||
String cmd = command[i];
|
String cmd = command[i];
|
||||||
if (obscureParam) {
|
if (StringUtils.isNotEmpty(cmd) && cmd.startsWith("vi://")) {
|
||||||
builder.append("******").append(" ");
|
String[] tokens = cmd.split("@");
|
||||||
obscureParam = false;
|
if (tokens.length >= 2) {
|
||||||
|
builder.append("vi://").append("******@").append(tokens[1]).append(" ");
|
||||||
} else {
|
} else {
|
||||||
builder.append(command[i]).append(" ");
|
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) {
|
if (obscureParam) {
|
||||||
builder.append("******").append(" ");
|
builder.append("******").append(" ");
|
||||||
obscureParam = false;
|
obscureParam = false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user