You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/03/18 14:25:00 UTC

[GitHub] [cloudstack] GabrielBrascher commented on a change in pull request #3980: Fix String.format unused/misused arguments

GabrielBrascher commented on a change in pull request #3980: Fix String.format unused/misused arguments
URL: https://github.com/apache/cloudstack/pull/3980#discussion_r394385294
 
 

 ##########
 File path: plugins/hypervisors/baremetal/src/main/java/com/cloud/baremetal/manager/BareMetalDiscoverer.java
 ##########
 @@ -205,7 +205,7 @@ public boolean stop() {
             zone.setDhcpProvider(Network.Provider.ExternalDhcpServer.getName());
             _dcDao.update(zone.getId(), zone);
 
-            s_logger.debug(String.format("Discover Bare Metal host successfully(ip=%1$s, username=%2$s, password=%3%s," +
+            s_logger.debug(String.format("Discover Bare Metal host successfully(ip=%1$s, username=%2$s, password=%3$s," +
                     "cpuNum=%4$s, cpuCapacity-%5$s, memCapacity=%6$s)", ipmiIp, username, "******", cpuNum, cpuCapacity, memCapacity));
 
 Review comment:
   WIthout the fix it will print something as:
   ```
   Discover Bare Metal host successfully(ip=ipmiIp, username=username, password=  %s,cpuNum=cpuNum, cpuCapacity-cpuCapacity, memCapacity=memCapacity)
   ```
   
   WIth the fix:
   ```
   Discover Bare Metal host successfully(ip=ipmiIp, username=username, password=******,cpuNum=cpuNum, cpuCapacity-cpuCapacity, memCapacity=memCapacity)
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services