cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [12/13] git commit: updated refs/heads/master to 967da97
Date Mon, 15 Jun 2015 09:07:02 GMT
Fix 1 findbugs warning in VmwareResource.java

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #409


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/11fec86b
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/11fec86b
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/11fec86b

Branch: refs/heads/master
Commit: 11fec86ba33754ff89791cc96388f35b3ff6b6f2
Parents: 474065e
Author: Rafael da Fonseca <rsafonseca@gmail.com>
Authored: Sun Jun 14 14:00:35 2015 +0200
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Mon Jun 15 12:06:11 2015 +0300

----------------------------------------------------------------------
 .../cloud/hypervisor/vmware/resource/VmwareResource.java    | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/11fec86b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index fbcb748..541f748 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -38,6 +38,7 @@ import java.util.Random;
 import java.util.Set;
 import java.util.TimeZone;
 import java.util.UUID;
+import java.io.UnsupportedEncodingException;
 
 import javax.naming.ConfigurationException;
 
@@ -3573,7 +3574,13 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
     }
 
     private static String getSecondaryDatastoreUUID(String storeUrl) {
-        return UUID.nameUUIDFromBytes(storeUrl.getBytes()).toString();
+        String uuid = null;
+        try{
+            uuid=UUID.nameUUIDFromBytes(storeUrl.getBytes("UTF-8")).toString();
+        }catch(UnsupportedEncodingException e){
+            s_logger.warn("Failed to create UUID from string " + storeUrl + ". Bad storeUrl
or UTF-8 encoding error." );
+        }
+        return uuid;
     }
 
     protected Answer execute(ValidateSnapshotCommand cmd) {


Mime
View raw message