JoaoJandre commented on code in PR #7140:
URL: https://github.com/apache/cloudstack/pull/7140#discussion_r1090956063


##########
server/src/main/java/com/cloud/alert/SecondaryStorageVmAlertAdapter.java:
##########
@@ -59,92 +59,100 @@ public void onSSVMAlert(Object sender, 
SecStorageVmAlertEventArgs args) {
             throw new CloudRuntimeException("Invalid alert arguments, 
secStorageVm must be set");
         }
 
+        String secStorageVmHostName = "";
+        String secStorageVmPublicIpAddress = "";
+        String secStorageVmPrivateIpAddress = "N/A";
+        Long secStorageVmPodIdToDeployIn = null;
+
+        if (secStorageVm != null) {
+            secStorageVmHostName = secStorageVm.getHostName();
+            secStorageVmPublicIpAddress = secStorageVm.getPublicIpAddress();
+            secStorageVmPrivateIpAddress = secStorageVm.getPrivateIpAddress() 
== null ? "N/A" : secStorageVm.getPrivateIpAddress();
+            secStorageVmPodIdToDeployIn = secStorageVm.getPodIdToDeployIn();
+        }

Review Comment:
   Hey @DaanHoogland, yes this is replicate code from the 
ConsoleProxyAlertAdapter, but is it worth it to make a utility method out of 
it? 
   To make the code clear I would probably have to create a new object to store 
this info and use it during these methods. In the end I would probably end up 
with more lines of code and a whole new class just for this.



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