PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  sec@s%dZddlZddlZddlZddlZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl mZddlmZddlmZddlmZddlmZmZmZdd lmZdd lmZmZdd lmZm Z m!Z!dd l"m#Z#m$Z$m%Z%e j&rpdd l'm(Z(ndd l m(Z(e j&re)Z*nej+e,Z-dZ.dZ/de0fdYZ1defdYZ2de(fdYZ3defdYZ4dej5fdYZ6dS(s Plugin framework. The classes in this module make heavy use of Python container emulation. If you are unfamiliar with this Python feature, see http://docs.python.org/ref/sequence-types.html iN(tpath(terrors(tEnv(t_(t classproperty(tReadOnlytlocktislocked(tDEFAULT_CONFIG(tipa_log_managertipautil(tlog_mgrtLOGGING_FORMAT_FILEtLOGGING_FORMAT_STDERR(tVERSIONt API_VERSIONtDEFAULT_PLUGINS(tMappings%s: need a %r; got a %r: %rccstjj||ko'tjj|s.dStjj|rDdSd}xttj|D]p}|j|s{q`ntjj||}tjj |sq`n|t | }|dkrq`n|Vq`WdS(s< Iterate through module names found in ``src_dir``. Ns.pyt__init__( tosRtabspathtisdirtislinktsortedtlistdirtendswithtjointisfiletlen(tsrc_dirtsuffixtnametpyfiletmodule((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pytfind_modules_in_dirGs* tRegistrycBs)eZdZdZdZdZRS(sA decorator that makes plugins available to the API Usage:: register = Registry() @register() class obj_mod(...): ... For forward compatibility, make sure that the module-level instance of this object is named "register". cCstj|_dS(N(t collectionst OrderedDictt_Registry__registry(tself((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRjsc sfd}|S(Ncs`t|std|n|jkrCtjd|ntd|j|<|S(s Register the plugin ``plugin``. :param plugin: A subclass of `Plugin` to attempt to register. splugin must be callable; got %rtplugin(tcallablet TypeErrorR&RtPluginDuplicateErrortdict(R((tkwargsR'(s3/usr/lib/python2.7/site-packages/ipalib/plugable.pytregisterns  ((R'R-R.((R-R's3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt__call__mscCst|jjS(N(titerR&tvalues(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt__iter__s(t__name__t __module__t__doc__RR/R2(((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyR#\s   tPlugincBseZdZdZdZedZeeZedZ ee Z edZ ee Z edZ ee ZedZeeZedZed Zed Zed Zd Zd ZdZdefdYZdZRS(s% Base class for all plugins. t1cCs>||_t|_t|_tj|_tj|t dS(N( t _Plugin__apitFalset_Plugin__finalize_calledt_Plugin__finalizedt threadingtRLockt_Plugin__finalize_lockR t get_loggertTrue(R'tapi((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRs    cCs|jS(N(R3(tcls((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt __name_getterscCsdj|j|jS(Ns{}/{}(tformatRtversion(RB((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt__full_name_getterscCs|jS(N(t __bases__(RB((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt__bases_getterscCs|jS(N(R5(RB((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt __doc_getterscCsP|j}t|js,d|j|jfSt|jdddjSdS(Nu<%s.%s>s ii(tdocRtmsgR4R3tunicodetsplittstrip(RBRJ((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt__summary_getters cCs|jS(s? Return `API` instance passed to `__init__()`. (R8(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRAscCs |jjS(N(R8tenv(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRPscCs |jjS(N(R8tBackend(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRQscCs |jjS(N(R8tCommand(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRRscCsY|jJ|jrdSt|_|jt|_|jjsOt|nWdQXdS(s Finalize plugin initialization. This method calls `_on_finalize()` and locks the plugin object. Subclasses should not override this method. Custom finalization is done in `_on_finalize()`. N(R>R:R@t _on_finalizeR;R8tis_production_modeR(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pytfinalizes     cCsdS(s Do custom finalization. This method is called from `finalize()`. Subclasses can override this method in order to add custom finalization. N((R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRSscCs*|j|js |jnWdQXdS(sR Finalize plugin initialization if it has not yet been finalized. N(R>R;RU(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pytensure_finalizeds  t finalize_attrcBs)eZdZdZddZdZRS(s/ Create a stub object for plugin attribute that isn't set until the finalization of the plugin initialization. When the stub object is accessed, it calls `ensure_finalized()` to make sure the plugin initialization is finalized. The stub object is expected to be replaced with the actual attribute value during the finalization (preferably in `_on_finalize()`), otherwise an `AttributeError` is raised. This is used to implement on-demand finalization of plugin initialization. RtvaluecCs||_||_dS(N(RRX(R'RRX((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRs cCst|dks|jdkr"|jS|jyt||jSWn-tk rotd|j|jfnXdS(Ns7attribute '%s' of plugin '%s' was not set in finalize()(tNoneRARXRVtgetattrRt RuntimeErrortAttributeError(R'tobjRB((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt__get__s  (snamesvalueN(R3R4R5t __slots__RYRR^(((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRWs  cCsd|jj|jjfS(s Return 'module_name.class_name()' representation. This representation could be used to instantiate this Plugin instance given the appropriate environment. s%s.%s()(t __class__R4R3(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt__repr__s (R3R4R5RERt classmethodt_Plugin__name_getterRRt_Plugin__full_name_gettert full_namet_Plugin__bases_gettertbasest_Plugin__doc_getterRJt_Plugin__summary_gettertsummarytpropertyRARPRQRRRURSRVtobjectRWRa(((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyR6s,         $t APINameSpacecBsYeZdZdZdZdZdZdZdZdZ dZ RS( cCs(||_||_d|_d|_dS(N(t_APINameSpace__apit_APINameSpace__baseRYt_APINameSpace__pluginst_APINameSpace__plugins_by_key(R'RAtbase((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyR$s   cs jdk r"jdk r"dSjj}t}i}_xjjD]}tfd|jDs|qQn|j ||||<|||j |j f<|||j <|j |j |j dkrQ|||j 3sR7tkeyRe(RpRYRqRnt_API__default_maptsett _API__pluginstanyRgtaddRRERetgetRtoperatort attrgetter(R't default_maptpluginstkey_dictR(((R's3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt __enumerate*s      cCs|jt|jS(N(t_APINameSpace__enumerateRRp(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt__len__>s cCs|j||jkS(N(RRq(R'Rv((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt __contains__Bs cCs|jt|jS(N(RR0Rp(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyR2Fs cCs|j|j|S(N(RRq(R'Rv((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt get_pluginJs cCs|j|}|jj|S(N(RRnt_get(R'RvR(((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt __getitem__NscCs tj|S(N(tsixt itervalues(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyR/RscCs0y ||SWntk r+t|nXdS(N(tKeyErrorR\(R'Rv((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt __getattr__Us  ( R3R4RRRRR2RRR/R(((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRm#s        tAPIcBseZdZdZedZedZdZdZdZ dZ dZ d Z d Z d Zd Zdd ZdddZdddZdZdZdZeedZdZdZdZRS(sK Dynamic API object through which `Plugin` instances are accessed. cCs_tt|jt|_i|_i|_i|_i|_t|_ t |_ dS(N( tsuperRRRxRyt_API__plugins_by_keyRwt_API__instancest _API__nextt _API__doneRRP(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRas      cCs tdS(N(tNotImplementedError(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRgkscCs tdS(N(R(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pytpackagesoscCs t|jS(sL Return the number of plugin namespaces in this API object. (RRg(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRsscCsd|jDS(sN Iterate (in ascending order) through plugin namespace names. css|]}|jVqdS(N(R3(RtRr((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pys }s(Rg(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyR2yscCs|t|kS(s Return True if this API object contains plugin namespace ``name``. :param name: The plugin namespace name to test for membership. (Rx(R'R((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRscCsD||kr4yt||SWq4tk r0q4Xnt|dS(s Return the plugin namespace corresponding to ``name``. :param name: The name of the plugin namespace you wish to retrieve. N(RZR\R(R'R((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRs   ccsGx@|D]8}yt||VWqtk r>t|qXqWdS(sQ Iterate (in ascending order by name) through plugin namespaces. N(RZR\R(R'R((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyR/s   cCst|jdddkS(s If the object has self.env.mode defined and that mode is production return True, otherwise return False. tmodet productionN(RZRPRY(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRTscCsB||jkr.td|jj|fn|jj|dS(Ns%s.%s() already called(Rt ExceptionR`R3R{(R'R((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt__doingscCs&||jkr"t||ndS(N(RRZ(R'R((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt__do_if_not_donescCs ||jkS(N(R(R'R((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pytisdonesc Ks|jdtj||_|jj||jjtt|sZ|j }n||_ t j }|j s|jjrdS|jjrt j}n t j}|j|x|jD]}tjd|}|sqntj|jd}t|j|}tjd|}x'|D]} |jtj| |q'WqWt j}|jjrot j}n<|jjdkr|jjdkrt j}qt j}nt j} | j|| j tj!t"|j#| |jj$d krdS|jjdkrdSt&j'|jj} t&j(| spyt)j*| Wqpt+k rlt,j-d | dSXnt j}|jjrt j}nyt j.|jj} Wn-t/k r} t,j-d |jj| dSX| j|| j tj!t0|j#| dS( s? Initialize environment variables and logging. t bootstrapNs?^log_logger_level_(debug|info|warn|warning|error|critical|\d+)$is\s*,\s*tcliitdummyt unit_testsCould not create log_dir %rsCannot open log file %r: %s(RR(1t _API__doingR R?tlogRPt _bootstrapt_finalize_coreR,Rtbuild_global_parsertparsertloggingt getLoggerthandlerst validate_apitdebugtDEBUGtINFOtsetLeveltretmatchR tconvert_log_leveltgroupRZRMt addFiltertFiltertcontexttverbosetWARNINGt StreamHandlert setFormattert FormatterR t addHandlerRRYRtdirnameRRtmakedirstOSErrortloggerterrort FileHandlertIOErrorR ( R'Rt overridest root_loggertleveltattrRRXtregexpstregexpthandlertlog_dirte((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRsr          !             cCsd}|d<krtjdtdtdddddd ttfd d jd d ddddg}|j|j ddddddn|j ddddddddd|j ddddd dd!d!|d"d#dd$|j d%d&dd'dd(|j d)dd'dd*|j d+d,dd-dd.|d/kr|j d0d1dd'dd2|j d3d4dd5dd6dd7|j d8d9dd5dd:dd;n|S(=sJ Add global options to an optparse.OptionParser instance. cSsEtjj|s5|jtdtd|n||j_dS(Ns%(filename)s: file not foundtfilename(RRRRRR,R1tconf(toptiontoptRXR((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pytconfig_file_callback stadd_help_optiont formattertusages0%prog [global-options] COMMAND [command-options]t descriptionsManage an IPA domainREsVERSION: %s, API_VERSION: %stepilogs s0See "ipa help topics" for available help topics.s/See "ipa help " for more information on sa specific topic.s6See "ipa help commands" for the full list of commands.s3See "ipa --help" for more information on sa specific command.s-hs--helptactionthelpsShow this help message and exits-etdestRPtmetavarsKEY=VALtappends#Set environment variable KEY to VALs-cRtFILEtcallbackttypetstringsLoad configuration from FILE.s-ds--debugt store_truesProduce full debuging outputs --delegates"Delegate the TGT to the IPA servers-vs --verbosetcountsEProduce more verbose output. A second -v displays the XML-RPC requestRs-as --prompt-alls(Prompt for ALL values (even if optional)s-ns --no-promptt store_falset interactives'Prompt for NO values (even if required)s-fs --no-fallbacktfallbacks7Only use the server configured in /etc/ipa/default.confN( RYtoptparset OptionParserR9tIPAHelpFormatterRRRtdisable_interspersed_argst add_option(R'RRR((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRsP          c Cs*|j||}|j\}}i}|jdk rx`|jD]R}y|jdd\}}Wntk rxnX|j|t|jsN(!RRRPt env_confdirRYtconfdirRtinfoRyRReRRwRRR t APIVersionRERTRgRztplugins_on_demandRR3tsetattrRmRRRRVR@t_API__finalizedR(R'R(tdefault_versionREtproduction_modeRtinstance((Rrs3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRUsP             cCs}t|std|n||jkr=t|ny|j|}Wn(tk rx||}|j|  ' 4 = RcBseZdZRS(csS|j|jd|j|j}djfd|D}d|S(Nt s c3s-|]#}tj|ddVqdS(tinitial_indenttsubsequent_indentN(ttextwraptfill(Rttline(tindentt text_width(s3/usr/lib/python2.7/site-packages/ipalib/plugable.pys 3ss %s (twidthtcurrent_indentt splitlinesR(R'ttexttlinestresult((R(R)s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt format_epilog.s   (R3R4R0(((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyR-s(7R5RR}RRR<RRRR%R$RRtipalibRt ipalib.configRt ipalib.textRt ipalib.utilRt ipalib.baseRRRtipalib.constantsRt ipapythonR R tipapython.ipa_log_managerR R R tipapython.versionRRRtPY3tcollections.abcRRRLRR3Rt TYPE_ERRORR"RlR#R6RmRtIndentedHelpFormatterR(((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pytsF               *9