You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2014/04/25 22:26:45 UTC
[05/16] git commit: updated refs/heads/4.4 to 6b342ff
CLOUDSTACK-6488 Fixed an issue where the "path" field was not being set properly in the DB when the volume had a snapshot taken of it
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/66fcfee2
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/66fcfee2
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/66fcfee2
Branch: refs/heads/4.4
Commit: 66fcfee22017d5c0314f4109913fa962274819b1
Parents: c6d1e10
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Wed Apr 23 10:32:55 2014 -0600
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Apr 25 21:35:24 2014 +0200
----------------------------------------------------------------------
.../manager/VmwareStorageManagerImpl.java | 27 ++++++++++++--------
1 file changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/66fcfee2/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
index e37bf38..fbba322 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
@@ -1169,21 +1169,28 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager {
if (input == null) {
return null;
}
+
String result = input;
- if (result.endsWith(".vmdk")) { // get rid of vmdk file extension
- result = result.substring(0, result.length() - (".vmdk").length());
+
+ final String fileType = ".vmdk";
+
+ if (result.endsWith(fileType)) {
+ // get rid of fileType
+ result = result.substring(0, result.length() - (fileType).length());
}
- if (result.split("-").length == 1) {
+
+ String[] str = result.split("-");
+ int length = str.length;
+
+ if (length == 1 || length == 2) {
return result;
}
- if (result.split("-").length > 2) {
- return result.split("-")[0] + "-" + result.split("-")[1];
- }
- if (result.split("-").length == 2) {
- return result.split("-")[0];
- } else {
- return result;
+
+ if (length > 2) {
+ return str[0] + "-" + str[1];
}
+
+ return result;
}
@Override