Skip to content

Commit 6fbc565

Browse files
Apply suggestions from code review
Co-authored-by: Suresh Kumar Anaparti <sureshkumar.anaparti@gmail.com>
1 parent a6689b6 commit 6fbc565

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

agent/src/main/java/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ private void launchConsoleProxy(final byte[] ksBits, final String ksPassword, fi
331331
final Object resource = this;
332332
logger.info("Building class loader for com.cloud.consoleproxy.ConsoleProxy");
333333
if (consoleProxyMain == null) {
334-
logger.info("Running com.cloud.consoleproxy.ConsoleProxy with encryptor password=******");
334+
logger.info("Running com.cloud.consoleproxy.ConsoleProxy");
335335
consoleProxyMain = new Thread(new ManagedContextRunnable() {
336336
@Override
337337
protected void runInContext() {

plugins/hypervisors/baremetal/src/main/java/com/cloud/baremetal/networkservice/BaremetalDnsmasqResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ public boolean configure(String name, Map<String, Object> params) throws Configu
4646
com.trilead.ssh2.Connection sshConnection = null;
4747
try {
4848
super.configure(name, params);
49-
logger.debug(String.format("Trying to connect to DHCP server(IP=%1$s, username=%2$s, password=******", _ip, _username));
49+
logger.debug(String.format("Trying to connect to DHCP server(IP=%1$s, username=%2$s", _ip, _username));
5050
sshConnection = SSHCmdHelper.acquireAuthorizedConnection(_ip, _username, _password);
5151
if (sshConnection == null) {
52-
throw new ConfigurationException(String.format("Cannot connect to DHCP server(IP=%1$s, username=%2$s, password=******", _ip, _username));
52+
throw new ConfigurationException(String.format("Cannot connect to DHCP server(IP=%1$s, username=%2$s", _ip, _username));
5353
}
5454

5555
if (!SSHCmdHelper.sshExecuteCmd(sshConnection, "[ -f '/usr/sbin/dnsmasq' ]")) {

plugins/hypervisors/baremetal/src/main/java/com/cloud/baremetal/networkservice/BaremetalKickStartPxeResource.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ private Answer execute(VmDataCommand cmd) {
130130

131131
sshConnection.connect(null, 60000, 60000);
132132
if (!sshConnection.authenticateWithPassword(_username, _password)) {
133-
logger.debug("SSH Failed to authenticate");
134-
throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s, password=******", _ip, _username));
133+
logger.debug("SSH Failed to authenticate with user {} credentials", _username);
134+
throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s", _ip, _username));
135135
}
136136

137137
String script = String.format("python /usr/bin/baremetal_user_data.py '%s'", arg);
@@ -167,7 +167,7 @@ private Answer execute(PrepareKickstartPxeServerCommand cmd) {
167167
sshConnection.connect(null, 60000, 60000);
168168
if (!sshConnection.authenticateWithPassword(_username, _password)) {
169169
logger.debug("SSH Failed to authenticate");
170-
throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s, password=******", _ip, _username));
170+
throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s", _ip, _username));
171171
}
172172

173173
String copyTo = String.format("%s/%s", _tftpDir, cmd.getTemplateUuid());

plugins/hypervisors/baremetal/src/main/java/com/cloud/baremetal/networkservice/BaremetalPingPxeResource.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ protected PreparePxeServerAnswer execute(PreparePxeServerCommand cmd) {
150150
try {
151151
sshConnection.connect(null, 60000, 60000);
152152
if (!sshConnection.authenticateWithPassword(_username, _password)) {
153-
logger.debug("SSH Failed to authenticate");
154-
throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s, password=******", _ip, _username));
153+
logger.debug("SSH Failed to authenticate with user {} credentials", _username);
154+
throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s", _ip, _username));
155155
}
156156

157157
String script =
@@ -179,7 +179,7 @@ protected Answer execute(PrepareCreateTemplateCommand cmd) {
179179
sshConnection.connect(null, 60000, 60000);
180180
if (!sshConnection.authenticateWithPassword(_username, _password)) {
181181
logger.debug("SSH Failed to authenticate");
182-
throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s, password=******", _ip, _username));
182+
throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s", _ip, _username));
183183
}
184184

185185
String script =
@@ -237,7 +237,7 @@ private Answer execute(VmDataCommand cmd) {
237237
sshConnection.connect(null, 60000, 60000);
238238
if (!sshConnection.authenticateWithPassword(_username, _password)) {
239239
logger.debug("SSH Failed to authenticate");
240-
throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s, password=******", _ip, _username));
240+
throw new ConfigurationException(String.format("Cannot connect to PING PXE server(IP=%1$s, username=%2$s", _ip, _username));
241241
}
242242

243243
String script = String.format("python /usr/bin/baremetal_user_data.py '%s'", arg);

utils/src/main/java/com/cloud/utils/UriUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ public static InputStream getInputStreamFromUrl(String url, String user, String
502502
Credentials defaultcreds = new UsernamePasswordCredentials(user, password);
503503
httpclient.getState().setCredentials(
504504
new AuthScope(hostAndPort.first(), hostAndPort.second(), AuthScope.ANY_REALM), defaultcreds);
505-
LOGGER.info("Added username={}, password=****** for host {}:{}"
505+
LOGGER.info("Added username={} along with password for host {}:{}"
506506
, user
507507
, hostAndPort.first()
508508
, hostAndPort.second());

0 commit comments

Comments
 (0)