cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject [50/50] [abbrv] git commit: updated refs/heads/4.4 to 48f8a95
Date Fri, 14 Mar 2014 13:58:47 GMT
Fixed all findbugs in hyperv plugin code


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

Branch: refs/heads/4.4
Commit: 6a4927f660f776bcbd12ae45f4e63ae2c2e96774
Parents: 4523f5d
Author: Rajesh Battala <rajesh.battala@citrix.com>
Authored: Wed Mar 12 11:32:44 2014 +0530
Committer: Rajesh Battala <rajesh.battala@citrix.com>
Committed: Fri Mar 14 17:36:43 2014 +0530

----------------------------------------------------------------------
 .../hyperv/src/com/cloud/ha/HypervInvestigator.java           | 4 ++--
 .../hypervisor/hyperv/discoverer/HypervServerDiscoverer.java  | 5 +++--
 .../hyperv/resource/HypervDirectConnectResource.java          | 7 ++++---
 3 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6a4927f6/plugins/hypervisors/hyperv/src/com/cloud/ha/HypervInvestigator.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/src/com/cloud/ha/HypervInvestigator.java b/plugins/hypervisors/hyperv/src/com/cloud/ha/HypervInvestigator.java
index cebfb7a..01d75fa 100644
--- a/plugins/hypervisors/hyperv/src/com/cloud/ha/HypervInvestigator.java
+++ b/plugins/hypervisors/hyperv/src/com/cloud/ha/HypervInvestigator.java
@@ -45,9 +45,9 @@ public class HypervInvestigator extends AdapterBase implements Investigator
{
     public Boolean isVmAlive(com.cloud.vm.VirtualMachine vm, Host host) {
         Status status = isAgentAlive(host);
         if (status == null) {
-            return null;
+            return false;
         }
-        return status == Status.Up ? true : null;
+        return status == Status.Up ? true : false;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6a4927f6/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/discoverer/HypervServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/discoverer/HypervServerDiscoverer.java
b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/discoverer/HypervServerDiscoverer.java
index c3d79c5..f4c15f6 100644
--- a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/discoverer/HypervServerDiscoverer.java
+++ b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/discoverer/HypervServerDiscoverer.java
@@ -19,6 +19,7 @@ package com.cloud.hypervisor.hyperv.discoverer;
 import java.net.InetAddress;
 import java.net.URI;
 import java.net.UnknownHostException;
+import java.nio.charset.Charset;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -254,7 +255,7 @@ public class HypervServerDiscoverer extends DiscovererBase implements
Discoverer
             // pool in the database
             // This GUID may change.
             if (cluster.getGuid() == null) {
-                cluster.setGuid(UUID.nameUUIDFromBytes(String.valueOf(clusterId).getBytes()).toString());
+                cluster.setGuid(UUID.nameUUIDFromBytes(String.valueOf(clusterId).getBytes(Charset.forName("UTF-8"))).toString());
                 _clusterDao.update(clusterId, cluster);
             }
 
@@ -318,7 +319,7 @@ public class HypervServerDiscoverer extends DiscovererBase implements
Discoverer
      * @return GUID in form of a string.
      */
     public static String calcServerResourceGuid(final String uuidSeed) {
-        String guid = UUID.nameUUIDFromBytes(uuidSeed.getBytes()).toString();
+        String guid = UUID.nameUUIDFromBytes(uuidSeed.getBytes(Charset.forName("UTF-8"))).toString();
         return guid;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6a4927f6/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java
b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java
index b1f5a67..13254a5 100644
--- a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java
+++ b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java
@@ -24,6 +24,7 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.nio.channels.SocketChannel;
+import java.nio.charset.Charset;
 import java.rmi.RemoteException;
 import java.security.KeyManagementException;
 import java.security.KeyStoreException;
@@ -597,7 +598,7 @@ public class HypervDirectConnectResource extends ServerResourceBase implements
S
     public ExecutionResult createFileInVR(String routerIp, String filePath, String fileName,
String content) {
         File keyFile = getSystemVMKeyFile();
         try {
-            SshHelper.scpTo(routerIp, 3922, "root", keyFile, null, filePath, content.getBytes(),
fileName, null);
+            SshHelper.scpTo(routerIp, 3922, "root", keyFile, null, filePath, content.getBytes(Charset.forName("UTF-8")),
fileName, null);
         } catch (Exception e) {
             s_logger.warn("Fail to create file " + filePath + fileName + " in VR " + routerIp,
e);
             return new ExecutionResult(false, e.getMessage());
@@ -1262,7 +1263,7 @@ public class HypervDirectConnectResource extends ServerResourceBase
implements S
         }
 
         try {
-            SshHelper.scpTo(controlIp, DEFAULT_DOMR_SSHPORT, "root", keyFile, null, "/tmp/",
tmpCfgFileContents.toString().getBytes(), routerIp.replace('.', '_') +
+            SshHelper.scpTo(controlIp, DEFAULT_DOMR_SSHPORT, "root", keyFile, null, "/tmp/",
tmpCfgFileContents.toString().getBytes(Charset.forName("UTF-8")), routerIp.replace('.', '_')
+
                 ".cfg", null);
 
             try {
@@ -1459,7 +1460,7 @@ public class HypervDirectConnectResource extends ServerResourceBase
implements S
         String json = new Gson().toJson(data);
         s_logger.debug("VM data JSON IS:" + json);
 
-        json = Base64.encodeBase64String(json.getBytes());
+        json = Base64.encodeBase64String(json.getBytes(Charset.forName("UTF-8")));
 
         String args = "-d " + json;
 


Mime
View raw message