Alon Bar-Lev has posted comments on this change.
Change subject: Applying usage for public key authentication method
......................................................................
Patch Set 4: (3 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java
Line 374: EngineSSHClient sshclient = new EngineSSHClient();
Line 375: sshclient.setVds(getParameters().getvds());
Line 376: sshclient.setHardTimeout(timeout);
Line 377: sshclient.setSoftTimeout(timeout);
Line 378: if (getParameters().getAuthMethod() ==
AuthenticationMethod.PublicKey) {
if you have enum... never assume else...
switch(enum) {
case a:
break;
case b:
break;
default:
throw new *Exception("invalid...");
}
Line 379: sshclient.useDefaultKeyPair();
Line 380: } else {
Line 381: sshclient.setPassword(getParameters().getPassword());
Line 382: }
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsDeploy.java
Line 835: /**
Line 836: * Main method.
Line 837: * Execute the command and initiate the dialog.
Line 838: */
Line 839: public void execute(AuthenticationMethod auth) throws Exception {
please have setter for this.
But best not to add this new dependency into VdsDeploy, just have two
methods....
setPassword(...)
useDefaultKeyPair(...)
and call these from the command based on the enum.
Line 840: InputStream in = null;
Line 841: try {
Line 842: _dialog.setHost(_vds.getHostName(), _vds.getSSHPort());
Line 843: setUser(_vds.getSSHUsername());
....................................................
File
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/EngineSSHClient.java
Line 56: String actual = getHostFingerprint();
Line 57: String expected = _vds.getSSHKeyFingerprint();
Line 58: if (expected == null || expected.isEmpty()) {
Line 59: _vds.setSSHKeyFingerprint(getHostFingerprint());
Line 60: // TODO: decide if db store is needed from here.
who do you refer to? I saw we should...
Line 61: } else if (!actual.equals(expected)) {
Line 62: throw new GeneralSecurityException(
Line 63: String.format(
Line 64: "Invalid fingerprint %s, expected %s",
--
To view, visit http://gerrit.ovirt.org/16270
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I54591b2b6cc99114f53124ee5a74c2b35f950304
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches