-
Notifications
You must be signed in to change notification settings - Fork 1.3k
vmware,storage: fix solidfire ROOT volume creation with vmware 6.5 and above #6548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3883e74
ff281cb
e0b0edb
96aa862
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,6 +21,8 @@ | |||||
| import java.util.ArrayList; | ||||||
| import java.util.List; | ||||||
|
|
||||||
| import org.apache.commons.collections.CollectionUtils; | ||||||
| import org.apache.commons.lang3.StringUtils; | ||||||
| import org.apache.log4j.Logger; | ||||||
|
|
||||||
| import com.cloud.exception.CloudException; | ||||||
|
|
@@ -314,16 +316,19 @@ public String[] listDirContent(String path) throws Exception { | |||||
| public boolean fileExists(String fileFullPath) throws Exception { | ||||||
| DatastoreFile file = new DatastoreFile(fileFullPath); | ||||||
| DatastoreFile dirFile = new DatastoreFile(file.getDatastoreName(), file.getDir()); | ||||||
|
|
||||||
| HostDatastoreBrowserMO browserMo = getHostDatastoreBrowserMO(); | ||||||
|
|
||||||
| s_logger.info("Search file " + file.getFileName() + " on " + dirFile.getPath()); | ||||||
| HostDatastoreBrowserSearchResults results = browserMo.searchDatastore(dirFile.getPath(), file.getFileName(), true); | ||||||
| if (results != null) { | ||||||
| List<FileInfo> info = results.getFile(); | ||||||
| if (info != null && info.size() > 0) { | ||||||
| s_logger.info("File " + fileFullPath + " exists on datastore"); | ||||||
| return true; | ||||||
| Boolean folderExists = true; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this true by default? |
||||||
| if(StringUtils.isNotBlank(file.getDir())){ | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| folderExists = folderExists(String.format("[%s]", file.getDatastoreName()), file.getDir()); | ||||||
| } | ||||||
| if (folderExists){ | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| HostDatastoreBrowserMO browserMo = getHostDatastoreBrowserMO(); | ||||||
| s_logger.info("Search file " + file.getFileName() + " on " + dirFile.getPath()); | ||||||
| HostDatastoreBrowserSearchResults results = browserMo.searchDatastore(dirFile.getPath(), file.getFileName(), true); | ||||||
| if (results != null) { | ||||||
| if (CollectionUtils.isNotEmpty(results.getFile())) { | ||||||
| s_logger.info("File " + fileFullPath + " exists on datastore"); | ||||||
| return true; | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
|
|
@@ -364,7 +369,7 @@ public long fileDiskSize(String fileFullPath) throws Exception { | |||||
|
|
||||||
| public boolean folderExists(String folderParentDatastorePath, String folderName) throws Exception { | ||||||
| HostDatastoreBrowserMO browserMo = getHostDatastoreBrowserMO(); | ||||||
|
|
||||||
| s_logger.info("Search folder " + folderName + " on " + folderParentDatastorePath); | ||||||
| HostDatastoreBrowserSearchResults results = browserMo.searchDatastore(folderParentDatastorePath, folderName, true); | ||||||
| if (results != null) { | ||||||
| List<FileInfo> info = results.getFile(); | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this consider minor release version as well?