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. t1cCsP|dk st||_t|_t|_tj|_t j |t dS(N( tNonetAssertionErrort _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(RD((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt__full_name_getterscCs|jS(N(t __bases__(RD((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt__bases_getterscCs|jS(N(R5(RD((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(RDRL((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt__summary_getters cCs|jS(s? Return `API` instance passed to `__init__()`. (R:(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRCscCs |jjS(N(R:tenv(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRRscCs |jjS(N(R:tBackend(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRSscCs |jjS(N(R:tCommand(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRTscCsn|j_|jtkst|jr,dSt|_|jt|_|jjsdt |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;R9R<RBt _on_finalizeR:tis_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.pyRUscCs*|j|js |jnWdQXdS(sR Finalize plugin initialization if it has not yet been finalized. N(R@R=RW(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(RRZ(R'RRZ((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()(R8RCRZRXtgetattrRt RuntimeErrortAttributeError(R'tobjRD((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt__get__s  (snamesvalueN(R3R4R5t __slots__R8RR_(((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRYs  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 (R3R4R5RGRt classmethodt_Plugin__name_getterRRt_Plugin__full_name_gettert full_namet_Plugin__bases_gettertbasest_Plugin__doc_getterRLt_Plugin__summary_gettertsummarytpropertyRCRRRSRTRWRURXtobjectRYRb(((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyR6s,         $t APINameSpacecBsYeZdZdZdZdZdZdZdZdZ dZ RS( cCs(||_||_d|_d|_dS(N(t_APINameSpace__apit_APINameSpace__baseR8t_APINameSpace__pluginst_APINameSpace__plugins_by_key(R'RCtbase((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 3sR7tkeyRf(RqR8RrRot_API__default_maptsett _API__pluginstanyRhtaddRRGRftgetRtoperatort 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__enumerateRRq(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt__len__>s cCs|j||jkS(N(RRr(R'Rw((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt __contains__Bs cCs|jt|jS(N(RR0Rq(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyR2Fs cCs|j|j|S(N(RRr(R'Rw((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt get_pluginJs cCs|j|}|jj|S(N(RRot_get(R'RwR(((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'Rw((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt __getattr__Us  ( R3R4RRRRR2RRR/R(((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRn#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( tsuperRRRyRzt_API__plugins_by_keyRxt_API__instancest _API__nextt _API__doneRRR(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.pyRhkscCs 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. (RRh(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(RuRs((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pys }s(Rh(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. (Ry(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(R[R]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(R[R]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(R[RRR8(R'((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRVscCsB||jkr.td|jj|fn|jj|dS(Ns%s.%s() already called(Rt ExceptionRaR3R|(R'R((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyt__doingscCs&||jkr"t||ndS(N(RR[(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 RAtlogRRt _bootstrapt_finalize_coreR,Rtbuild_global_parsertparsertloggingt getLoggerthandlerst validate_apitdebugtDEBUGtINFOtsetLeveltretmatchR tconvert_log_leveltgroupR[ROt addFiltertFiltertcontexttverbosetWARNINGt StreamHandlert setFormattert FormatterR t addHandlerRR8RtdirnameRRtmakedirstOSErrortloggerterrort FileHandlertIOErrorR ( R'Rt overridest root_loggertleveltattrRRZtregexpstregexpthandlertlog_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(toptiontoptRZR((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 domainRGsVERSION: %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-etdestRRtmetavarsKEY=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( R8toptparset OptionParserR;tIPAHelpFormatterRRRtdisable_interspersed_argst add_option(R'RRR((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRsP          c CsE|j||}|j\}}i}|jdk rt|jtksTtx`|jD]R}y|jdd\}}Wntk rnX|j |t |j sN(%RRRRt env_confdirR8tconfdirRtinfoRzRRfRRxRRR t APIVersionRGRVRhR{tplugins_on_demandRR3RR9tsetattrRnRRRRCRXRRBt_API__finalizedR(R'R(tdefault_versionRGtproduction_modeRtinstance((Rss3/usr/lib/python2.7/site-packages/ipalib/plugable.pyRWsP            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(Rutline(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   (R3R4R2(((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.abcRRRNRR3Rt TYPE_ERRORR"RmR#R6RnRtIndentedHelpFormatterR(((s3/usr/lib/python2.7/site-packages/ipalib/plugable.pytsF               *9