Alon Bar-Lev has uploaded a new change for review.

Change subject: host-deploy: cleanup: favor Charset.getName() over plain string
......................................................................

host-deploy: cleanup: favor Charset.getName() over plain string

Change-Id: Ifa209cebf9efa5dc6c8e3f50447c9af25fcf9c2f
Signed-off-by: Alon Bar-Lev <alo...@redhat.com>
---
M 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHClient.java
M 
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHDialog.java
2 files changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/91/13191/1

diff --git 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHClient.java
 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHClient.java
index e645ee6..6773aab 100644
--- 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHClient.java
+++ 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHClient.java
@@ -9,6 +9,7 @@
 import java.io.OutputStream;
 import java.io.PipedInputStream;
 import java.io.PipedOutputStream;
+import java.nio.charset.Charset;
 import java.net.SocketAddress;
 import java.security.DigestInputStream;
 import java.security.DigestOutputStream;
@@ -621,7 +622,7 @@
                 throw new IllegalStateException("Cannot stop SSH stream 
thread");
             }
 
-            _validateDigest(localDigest, new 
String(remoteDigest.toByteArray(), "UTF-8").trim());
+            _validateDigest(localDigest, new 
String(remoteDigest.toByteArray(), Charset.forName("UTF-8")).trim());
         }
         catch(Exception e) {
             log.debug("Send failed", e);
@@ -720,7 +721,7 @@
                 throw new IllegalStateException("Cannot stop SSH stream 
thread");
             }
 
-            _validateDigest(localDigest, new 
String(remoteDigest.toByteArray(), "UTF-8").trim());
+            _validateDigest(localDigest, new 
String(remoteDigest.toByteArray(), Charset.forName("UTF-8")).trim());
         }
         catch(Exception e) {
             log.debug("Receive failed", e);
diff --git 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHDialog.java
 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHDialog.java
index 38e2510..248a749 100644
--- 
a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHDialog.java
+++ 
b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHDialog.java
@@ -7,6 +7,7 @@
 import java.io.PipedInputStream;
 import java.io.PipedOutputStream;
 import java.io.SequenceInputStream;
+import java.nio.charset.Charset;
 import java.security.KeyPair;
 import java.security.PublicKey;
 import java.util.Arrays;
@@ -322,7 +323,7 @@
                             "SSH stderr during command %1$s:'%2$s': stderr: 
%3$s",
                             _client.getDisplayHost(),
                             command,
-                            new String(stderr.toByteArray(), "UTF-8")
+                            new String(stderr.toByteArray(), 
Charset.forName("UTF-8"))
                         )
                     );
                 }


--
To view, visit http://gerrit.ovirt.org/13191
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa209cebf9efa5dc6c8e3f50447c9af25fcf9c2f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to