Yaniv Bronhaim has posted comments on this change.
Change subject: API: Do not require root password for host add
......................................................................
Patch Set 1:
(1 comment)
....................................................
File
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostsResource.java
Line 86:
Line 87: @Override
Line 88: public Response add(Host host) {
Line 89: validateEnums(Host.class, host);
Line 90: validateParameters(host, "name", "address");
interesting how we missed that.. anyway, we could validate that if ssh field is
set we don't need to require rootPassword, otherwise we do have to have this
field.
would you prefer something like:
if (host.isSetSsh()) {
validateParameters(host, "name", "address", "authenticationMethod");
} else {
validateParameters(host, "name", "address", "rootPassword");
}
or being more specific and actually check here the authenticationMethod and
verify that if password is set the ssh.password should be exist, or
rootPassword, and if password exists also user field should be there.. it makes
the validation much more specific. is that the right location for that? or
checking the above is enough for here?
anyhow, those validation are quite rare.. we have bunch of fields that we don't
validate at all in this file.
Line 91: VdsStatic staticHost = getMapper(Host.class,
VdsStatic.class).map(host, null);
Line 92: staticHost.setVdsGroupId(getClusterId(host));
Line 93: AddVdsActionParameters addParams = new
AddVdsActionParameters(staticHost, host.getRootPassword());
Line 94: if (host.isSetOverrideIptables()) {
--
To view, visit http://gerrit.ovirt.org/18002
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I506b844df10acfc17dcbce271755d37fdcdf0c7e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yedidyah Bar David <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: Yedidyah Bar David <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches