On 8/31/2011 3:46 AM, Petr Vobornik wrote:
On 08/30/2011 09:06 PM, Endi Sukma Dewata wrote:
The memberof_netgroup association facet for hostgroup has been
explicitly defined to use the serial associator so it will invoke
the right methods.

Ticket #1737
ACK

Pushed to master and ipa-2-1.

I think, we should unite the usage of serial and bulk associators.
Currently the usage of entity and other_entity is inverted. This could
be achieved by proper initialization of spec from association type
(association name - something similar to what is used now in
association_table) and do not blindly copy entity from facet as it is
done now (association entity often isn't equal to facet entity (eg in
memberof association)). This could be part of
https://fedorahosted.org/freeipa/ticket/1690 .

I agree that the associators need some cleanup. The serial & bulk associators right now determines the type of the association. MemberOf association uses serial because the 'entity' has to be added into 'other entities' using multiple <other_entity>-add-member commands. Member association uses bulk because the 'other entities' can be added into the 'entity' at once using a single <entity>-add-member command.

We could combine them into a single class and use a variable 'type' to determine how to generate the commands. We could also keep them separate and use the class itself to determine the 'type'. We would rename them into memberof_association and member_association. Then the association_facet() in the entity_builder will map the association names into the right 'type'. That way we don't have to specify it explicitly in the entity declarations.

--
Endi S. Dewata

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to