R4Sc@sodZddlZyddlTeZWnek r?eZnXddljj Z dej fdYZ dS(smodule describing a user packaging object This module contains the UserAction class, which represents a user packaging object. This contains the attributes necessary to create a new user.iN(t*t GroupActioncBseZdZgZdZdZeZej eZ dZ e dZ dZdZdZdZd d Zd ZRS( sClass representing a group packaging object. note that grouplist members are selected via the user action, although they are stored in the /etc/group file. Use of group passwds is not supported.tgroupt groupnamecs tfdjDS(sw return a dictionary containing attrs in attr list from self.attrs; omit if no such attrs in self.attrsc3s.|]$}|kr|j|fVqdS(N(tattrs(t.0ta(tattrlisttself(s7/usr/lib/python2.7/vendor-packages/pkg/actions/group.pys :s(tdictR(RR((RRs7/usr/lib/python2.7/vendor-packages/pkg/actions/group.pytextract7sc CsMts dS|jddg}t|j}|j|}|r{|d|jdkrt|}|jd|ds0   cCsA|jj}|r=||ks$t|j||dtndS(NR"(RRtAssertionErrorR)tTrue(RR R!tgroups((s7/usr/lib/python2.7/vendor-packages/pkg/actions/group.pyt postinstalljs c Ks]g}g}g}ts%|||fSt|}|j|j}td|jjD}d|jkrd|ds R R.s ss user-lists/%(entry)s: '%(found)s' should be '%(expected)s'tentrytfoundtexpectedN( RRRRR tgetdefaultvaluest iteritemstcopytupdatet setdefaulttpoptNoneR( RR(targsterrorstwarningstinfoR$R%tgrdefvalt should_beR/R((s7/usr/lib/python2.7/vendor-packages/pkg/actions/group.pytverifyps0        GcCsrts dSt|j}|j|j}d|krny|j|jWntk r`}qnX|jndS(s*client-side method that removes this groupNs user-list(RRRRRt removevaluetKeyErrorR(RR R$R%R&((s7/usr/lib/python2.7/vendor-packages/pkg/actions/group.pytremoves cCsdd|jddfgS(swGenerates the indices needed by the search dictionary. See generic.py for a more detailed explanation.RtnameRN(RR:(R((s7/usr/lib/python2.7/vendor-packages/pkg/actions/group.pytgenerate_indicesscCs&tjj|d|dddddS(sJPerforms additional validation of action attributes that for performance or other reasons cannot or should not be done during Action object creation. An ActionError exception (or subclass of) will be raised if any attributes are not valid. This is primarily intended for use during publication or during error handling to provide additional diagonostics. 'fmri' is an optional package FMRI (object or string) indicating what package contained this action. Rt numeric_attrsR t single_attrsN(sgid(sgid(tgenerictActiont _validate(RR((s7/usr/lib/python2.7/vendor-packages/pkg/actions/group.pytvalidates cCs7tt|jjddt|jjddS(sArrange for group actions to be installed in gid order. This will only hold true for actions installed at one time, but that's generally what we need on initial install.R i(tcmpRRtget(Rtother((s7/usr/lib/python2.7/vendor-packages/pkg/actions/group.pytcomparesN(t__name__t __module__t__doc__t __slots__REtkey_attrR+tglobally_identicalRIt _orderdictt ordinalityR tFalseR)R-RARDRFR:RLRP(((s7/usr/lib/python2.7/vendor-packages/pkg/actions/group.pyR*s   ,  1   ( RSRIt pkg.cfgfilesR+Rt ImportErrorRYtpkg.client.api_errorstclientt api_errorsRRJR(((s7/usr/lib/python2.7/vendor-packages/pkg/actions/group.pyts