weizhouapache commented on code in PR #12571:
URL: https://github.com/apache/cloudstack/pull/12571#discussion_r2786631608


##########
engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java:
##########
@@ -2093,6 +2093,24 @@ public void propagateChangeToAgents(Map<String, String> 
params) {
         }
     }
 
+    @Override
+    public int getHostSshPort(HostVO host) {
+        if (host == null) {
+            return AgentManager.KVMHostDiscoverySshPort.value();
+        }
+
+        _hostDao.loadDetails(host);
+        String hostPort = host.getDetail(Host.HOST_SSH_POST);
+        int sshPort;
+        if (com.cloud.utils.StringUtils.isBlank(hostPort)) {

Review Comment:
   we could use `org.apache.commons.lang3.StringUtils` which has been imported 
in AgentManagerImpl.java



##########
engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java:
##########
@@ -2093,6 +2093,24 @@ public void propagateChangeToAgents(Map<String, String> 
params) {
         }
     }
 
+    @Override
+    public int getHostSshPort(HostVO host) {
+        if (host == null) {
+            return AgentManager.KVMHostDiscoverySshPort.value();
+        }
+
+        _hostDao.loadDetails(host);
+        String hostPort = host.getDetail(Host.HOST_SSH_POST);
+        int sshPort;
+        if (com.cloud.utils.StringUtils.isBlank(hostPort)) {
+            sshPort = 
AgentManager.KVMHostDiscoverySshPort.valueIn(host.getClusterId());

Review Comment:
   ```suggestion
               sshPort = KVMHostDiscoverySshPort.valueIn(host.getClusterId());
   ```
   I this this works ?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to