nvazquez commented on a change in pull request #5380:
URL: https://github.com/apache/cloudstack/pull/5380#discussion_r697809964



##########
File path: 
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
##########
@@ -263,6 +268,18 @@ public VmwareManagerImpl() {
         _storageMgr = new VmwareStorageManagerImpl(this);
     }
 
+    private boolean isSystemVmIsoCopyNeeded(File srcIso, File destIso) {
+        boolean copyNeeded = !destIso.exists();
+        if (!copyNeeded) {

Review comment:
       ```suggestion
           if (!destIso.exists()) {
              return true;
           }
   ```

##########
File path: 
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
##########
@@ -263,6 +268,18 @@ public VmwareManagerImpl() {
         _storageMgr = new VmwareStorageManagerImpl(this);
     }
 
+    private boolean isSystemVmIsoCopyNeeded(File srcIso, File destIso) {
+        boolean copyNeeded = !destIso.exists();
+        if (!copyNeeded) {
+            try {
+                copyNeeded = !StringUtils.equals(DigestUtils.md5Hex(new 
FileInputStream(srcIso)), DigestUtils.md5Hex(new FileInputStream(destIso)));

Review comment:
       Maybe also add a log line in case copyNeeded == true?

##########
File path: 
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
##########
@@ -263,6 +268,18 @@ public VmwareManagerImpl() {
         _storageMgr = new VmwareStorageManagerImpl(this);
     }
 
+    private boolean isSystemVmIsoCopyNeeded(File srcIso, File destIso) {
+        boolean copyNeeded = !destIso.exists();
+        if (!copyNeeded) {
+            try {
+                copyNeeded = !StringUtils.equals(DigestUtils.md5Hex(new 
FileInputStream(srcIso)), DigestUtils.md5Hex(new FileInputStream(destIso)));

Review comment:
       ```suggestion
                   String srcIsoMd5 = DigestUtils.md5Hex(new 
FileInputStream(srcIso));
                   String destIsoMd5 = DigestUtils.md5Hex(new 
FileInputStream(destIso));
                   copyNeeded = !StringUtils.equals(srcIsoMd5, destIsoMd5);
   ```




-- 
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: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to