DaanHoogland commented on a change in pull request #3576: [WIP] vmware: try to 
find exact file when multiple files are returned
URL: https://github.com/apache/cloudstack/pull/3576#discussion_r323209218
 
 

 ##########
 File path: 
vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/DatastoreMO.java
 ##########
 @@ -416,22 +414,39 @@ public String searchFileInSubFolders(String fileName, 
boolean caseInsensitive, S
             s_logger.error(msg);
             throw new CloudException(msg);
         }
+        String parentFolderPath;
+        String absoluteFileName = null;
         for (HostDatastoreBrowserSearchResults result : results) {
             List<FileInfo> info = result.getFile();
             if (info != null && info.size() > 0) {
                 for (FileInfo fi : info) {
-                    absoluteFileName = parentFolderPath = 
result.getFolderPath();
-                    s_logger.info("Found file " + fileName + " in datastore at 
" + absoluteFileName);
-                    if (parentFolderPath.endsWith("]"))
-                        absoluteFileName += " ";
-                    absoluteFileName += fi.getPath();
-                    if(isValidCloudStackFolderPath(parentFolderPath, 
searchExcludedFolders)) {
+                    String possibleFilename = null;
+                    possibleFilename = parentFolderPath = 
result.getFolderPath();
 
 Review comment:
   should this double assignment really be here? it does not make the code 
clearer.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to