Ori Liel has posted comments on this change. Change subject: api: Fix approve API to allow deploy with public key ......................................................................
Patch Set 10: (2 comments) http://gerrit.ovirt.org/#/c/27622/10/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostResource.java File backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendHostResource.java: Line 141: VdsOperationActionParameters.AuthenticationMethod authMethod = Line 142: VdsOperationActionParameters.AuthenticationMethod.PublicKey; Line 143: Line 144: if (action.isSetSsh() && action.getSsh().isSetAuthenticationMethod()) { Line 145: if (action.getSsh().getAuthenticationMethod().equals( IIUC, ssh is now an additional parameter that the client may pass for this action (and specifically, 'user' within ssh). Please add this parameter in rsdl_metadata.yaml Line 146: VdsOperationActionParameters.AuthenticationMethod.Password.toString())) { Line 147: authMethod = VdsOperationActionParameters.AuthenticationMethod.Password; Line 148: if (action.isSetRootPassword()) { Line 149: params.setRootPassword(action.getRootPassword()); Line 142: VdsOperationActionParameters.AuthenticationMethod.PublicKey; Line 143: Line 144: if (action.isSetSsh() && action.getSsh().isSetAuthenticationMethod()) { Line 145: if (action.getSsh().getAuthenticationMethod().equals( Line 146: VdsOperationActionParameters.AuthenticationMethod.Password.toString())) { You are comparing something in the API 'language' (action.getSsh()) to something in the engine 'language' - VdsOperationActionParameters.AuthenticationMethod.Password. We don't create such dependencies, because tomorrow an engine developer might decide to change VdsOperationActionParameters.AuthenticationMethod in some way that would break API. This is why for every engine enum we have an equivalent API enum, and hard-coded mapping. Even though it's a ton of duplication, that is the way to completely decouple the engine from the API. Line 147: authMethod = VdsOperationActionParameters.AuthenticationMethod.Password; Line 148: if (action.isSetRootPassword()) { Line 149: params.setRootPassword(action.getRootPassword()); Line 150: } else if (action.getSsh().isSetUser()) { -- To view, visit http://gerrit.ovirt.org/27622 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9816d907d45ec7b4ee066fa369ca1150e688084f Gerrit-PatchSet: 10 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yaniv Bronhaim <[email protected]> Gerrit-Reviewer: Alon Bar-Lev <[email protected]> Gerrit-Reviewer: Juan Hernandez <[email protected]> Gerrit-Reviewer: Ori Liel <[email protected]> Gerrit-Reviewer: Oved Ourfali <[email protected]> Gerrit-Reviewer: Yaniv Bronhaim <[email protected]> Gerrit-Reviewer: [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
