Ñò ìÿÒXc@s€ddkTddklZlZlZlZlZddklZl Z ddk l Z edƒZ de fd„ƒYZeieƒdefd „ƒYZeieƒd efd „ƒYZeieƒd efd „ƒYZeieƒdefd„ƒYZeieƒdefd„ƒYZeieƒdefd„ƒYZeieƒdefd„ƒYZeieƒdS(iÿÿÿÿ(t*(tapitIntt_tngettextterrors(tNETGROUP_PATTERNtNETGROUP_PATTERN_ERRMSG(tDNsÒ Groups of hosts. Manage groups of hosts. This is useful for applying access control to a number of hosts by using Host-based Access Control. EXAMPLES: Add a new host group: ipa hostgroup-add --desc="Baltimore hosts" baltimore Add another new host group: ipa hostgroup-add --desc="Maryland hosts" maryland Add members to the hostgroup: ipa hostgroup-add-member --hosts=box1,box2,box3 baltimore Add a hostgroup as a member of another hostgroup: ipa hostgroup-add-member --hostgroups=baltimore maryland Remove a host from the hostgroup: ipa hostgroup-remove-member --hosts=box2 baltimore Display a host group: ipa hostgroup-show baltimore Delete a hostgroup: ipa hostgroup-del baltimore t hostgroupcBs/eZdZeiiZedƒZedƒZ ddgZ ddddd d gZ d Z hd d gd6d dddgd6d d gd 6d ddgd 6Z edƒZedƒZeddededddedƒdedƒdedd„ƒeddddedƒded ƒƒfZd!„ZRS("s Hostgroup object. s host groups host groupst ipaobjectt ipahostgrouptcnt descriptiontmembertmemberoftmemberindirecttmemberofindirectt ipauniqueidthostR tnetgroupthbacruletsudorules Host Groupss Host Grouptpatterntpattern_errmsgtcli_namethostgroup_nametlabels Host-grouptdocsName of host-groupt primary_keyt normalizercCs |iƒS((tlower(tvalue((s</usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.pytVstdesct Descriptions A description of this host-groupc CsÇt|ƒ}x´t|idgƒƒD]š}t|ƒ}|d|djoq%n|ihdd6ƒ}y,|id|d|d|idd gƒWntij oq%X|di|ƒq%Wd S( sh We don't want to show managed netgroups so remove them from the memberOf list. RR tmepmanagedentryt objectclasstfiltertbase_dntscopet attrs_listtN( Rtlisttgett make_filtert find_entriest SCOPE_BASERtNotFoundtremove(tselftldaptdnt entry_attrsthgdnRtngdnR&((s</usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.pytsuppress_netgroup_memberof_s  (t__name__t __module__t__doc__Rtenvtcontainer_hostgroupt container_dnRt object_nametobject_name_pluralt object_classtdefault_attributestuuid_attributetattribute_membersRtlabel_singulartStrRRtTruet takes_paramsR8(((s</usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.pyR 8s8                t hostgroup_addcBs2eZedƒZedƒZd„Zd„ZRS(sAdd a new hostgroup.sAdded hostgroup "%(value)s"c Os»t|tƒpt‚y,tidi|dƒ|ii|ŒWnti j onXyBtidi|dƒti dt t dƒ|dƒƒ‚Wnti j onX|S(NR iÿÿÿÿRtmessageuYnetgroup with name "%s" already exists. Hostgroups and netgroups share a common namespace( t isinstanceRtAssertionErrorRtObjecttget_dn_if_existstobjthandle_duplicate_entryRR0tDuplicateEntrytunicodeR(R2R3R4R5R)tkeystoptions((s</usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.pyt pre_callback{scOsSt|tƒpt‚t||ddƒ}t||ƒ|ii|||ƒ|S(NR%tmepOriginEntry(RKRRLtwait_for_valuetentry_from_entryROR8(R2R3R4R5RSRTtnewentry((s</usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.pyt post_callback‘s  (R9R:RR;t msg_summaryRURZ(((s</usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.pyRIvs   t hostgroup_delcBs eZedƒZedƒZRS(sDelete a hostgroup.sDeleted hostgroup "%(value)s"(R9R:RR;R[(((s</usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.pyR\Ÿs t hostgroup_modcBs)eZedƒZedƒZd„ZRS(sModify a hostgroup.sModified hostgroup "%(value)s"cOs1t|tƒpt‚|ii|||ƒ|S(N(RKRRLROR8(R2R3R4R5RSRT((s</usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.pyRZ¬s(R9R:RR;R[RZ(((s</usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.pyR]§s  thostgroup_findcBs;eZedƒZddgZedddƒZd„ZRS(sSearch for hostgroups.RRs%(count)d hostgroup matcheds%(count)d hostgroups matchedic OsO|idtƒo|Sx0|D](}|\}}|ii|||ƒqW|S(Nt pkey_only(R,tFalseROR8( R2R3tentriest truncatedtargsRTtentryR4R5((s</usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.pyRZ¼s (R9R:RR;tmember_attributesRR[RZ(((s</usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.pyR^´s   thostgroup_showcBseZedƒZd„ZRS(s&Display information about a hostgroup.cOs1t|tƒpt‚|ii|||ƒ|S(N(RKRRLROR8(R2R3R4R5RSRT((s</usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.pyRZÊs(R9R:RR;RZ(((s</usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.pyRfÇs thostgroup_add_membercBseZedƒZd„ZRS(sAdd members to a hostgroup.cOs7t|tƒpt‚|ii|||ƒ||fS(N(RKRRLROR8(R2R3t completedtfailedR4R5RSRT((s</usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.pyRZÕs(R9R:RR;RZ(((s</usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.pyRgÒs thostgroup_remove_membercBseZedƒZd„ZRS(s Remove members from a hostgroup.cOs7t|tƒpt‚|ii|||ƒ||fS(N(RKRRLROR8(R2R3RhRiR4R5RSRT((s</usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.pyRZàs(R9R:RR;RZ(((s</usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.pyRjÝs N(tipalib.plugins.baseldaptipalibRRRRRtipalib.plugins.netgroupRRt ipapython.dnRR;t LDAPObjectR tregistert LDAPCreateRIt LDAPDeleteR\t LDAPUpdateR]t LDAPSearchR^t LDAPRetrieveRft LDAPAddMemberRgtLDAPRemoveMemberRj(((s</usr/lib/python2.6/site-packages/ipalib/plugins/hostgroup.pyts* ( ; &