Juan Hernandez has posted comments on this change.

Change subject: restapi: Allow enabling/disabling SSO
......................................................................


Patch Set 3:

(3 comments)

Please add tests to BackendVmResourceTest and BackendVmsResourceTest to verify 
that adding/updating a VM without specifying the <sso> tag works as it used to 
work.

I apologize for not commenting all this in the first review, but it is 
important.

....................................................
File 
backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
Line 2306:     </xs:sequence>
Line 2307:   </xs:complexType>
Line 2308: 
Line 2309:   <xs:complexType name="SsoMethods">
Line 2310:     <xs:sequence>
Please add this here:

  <xs:annotation>
    <xs:appinfo>
      <jaxb:property name="methods"/>
    </xs:appinfo>
  </xs:annotation>

This way the resulting java code will be "sso.getMethods().getMethods()" which 
is more consistent with the List return type than "getMethods().getMethod()".
Line 2311:       <xs:element name="method" type="SsoMethod" minOccurs="0" 
maxOccurs="unbounded" />
Line 2312:     </xs:sequence>
Line 2313:   </xs:complexType>
Line 2314: 


....................................................
File 
backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
Line 75:           vm.description: xs:string
Line 76:           vm.comment: xs:string
Line 77:           vm.stateless: xs:boolean
Line 78:           vm.delete_protected: xs:boolean
Line 79:           vm.sso.methods.method: --COLLECTION: {method: 'xs:string'}
Confirmed, the correct syntax is as I mentioned in the previous comment. Please 
fix it and verify that the RSDl (/api?rsdl) is generated correctly.
Line 80:           vm.console.enabled: xs:boolean
Line 81:           vm.cpu.topology.sockets: xs:int
Line 82:           vm.placement_policy.affinity: xs:string
Line 83:           vm.placement_policy.host.id|name: xs:string


....................................................
File 
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/SsoMapper.java
Line 21:         return model;
Line 22:     }
Line 23: 
Line 24:     @Mapping(from = Sso.class, to = SsoMethod.class)
Line 25:     public static SsoMethod map(Sso model, SsoMethod template) {
In order to preserve backwards compatibility you need to make sure that if the 
<sso> element isn't provided then the VM is assigned the GEST_AGENT method. 
Otherwise when adding or updating VMs without the <sso> element the SSO 
mechanism will be effectively disabled.

Please verify that adding an VM without the <sso> tag is possible and that it 
creates it with the GUEST_AGENT method. Same for update.
Line 26:         if (model != null && model.getMethods() != null && 
model.getMethods().getMethod() != null && model.getMethods().getMethod().size() 
== 1) {
Line 27:             if (model.getMethods().getMethod().get(0) == 
org.ovirt.engine.api.model.SsoMethod.GUEST_AGENT) {
Line 28:                 return SsoMethod.GUEST_AGENT;
Line 29:             }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I25bf94646ea89684152e48f25ad604db6e59e86c
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Frank Kobzik <[email protected]>
Gerrit-Reviewer: Frank Kobzik <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Ori Liel <[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

Reply via email to