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

Change subject: host-deploy: prepare upgrade to apache-sshd 0.11.0
......................................................................

host-deploy: prepare upgrade to apache-sshd 0.11.0

since 3.1 we use internal implementation of KeyPairProvider which was
changed in future releases, in order to make transition easier drop the
internal implementation in favour of super interface.

required subset of I6943590f1c without implications.

Related-To: https://bugzilla.redhat.com/show_bug.cgi?id=1094123
Related-To: https://bugzilla.redhat.com/show_bug.cgi?id=1093882
Change-Id: I6943590f1c479e71633dcce1180028e06c9a9a17
Signed-off-by: Alon Bar-Lev <[email protected]>
---
M 
backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/ssh/SSHD.java
1 file changed, 19 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/49/27549/1

diff --git 
a/backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/ssh/SSHD.java
 
b/backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/ssh/SSHD.java
index efbc70f..9064aaf 100644
--- 
a/backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/ssh/SSHD.java
+++ 
b/backend/manager/modules/utils/src/test/java/org/ovirt/engine/core/utils/ssh/SSHD.java
@@ -5,9 +5,11 @@
 import java.security.KeyPairGenerator;
 import java.security.NoSuchAlgorithmException;
 import java.security.PublicKey;
+import java.util.LinkedList;
+import java.util.List;
 
 import org.apache.sshd.SshServer;
-import org.apache.sshd.common.keyprovider.AbstractKeyPairProvider;
+import org.apache.sshd.common.KeyPairProvider;
 import org.apache.sshd.server.Command;
 import org.apache.sshd.server.CommandFactory;
 import org.apache.sshd.server.PasswordAuthenticator;
@@ -47,7 +49,7 @@
         }
     }
 
-    static class MyKeyPairProvider extends AbstractKeyPairProvider {
+    static class MyKeyPairProvider implements KeyPairProvider {
         KeyPair _keyPair;
 
         public MyKeyPairProvider(KeyPair keyPair) {
@@ -55,8 +57,21 @@
         }
 
         @Override
-        protected KeyPair[] loadKeys() {
-            return new KeyPair[] { _keyPair };
+        public KeyPair loadKey(String type) {
+            return _keyPair;
+        }
+
+        /* >=0.10 */
+        //@Override
+        public Iterable<KeyPair> loadKeys() {
+            List<KeyPair> ret = new LinkedList<>();
+            ret.add(_keyPair);
+            return ret;
+        }
+
+        @Override
+        public String getKeyTypes() {
+            return SSH_RSA;
         }
     }
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6943590f1c479e71633dcce1180028e06c9a9a17
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Alon Bar-Lev <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to