Ñò Ã#xPc@s«dZddkZddkZddkZddklZlZlZddkl Z l Z l Z dei fd„ƒYZ de fd„ƒYZd e fd „ƒYZdS( s* Base classes for all backed-end plugins. iÿÿÿÿN(t PublicErrort InternalErrort CommandError(tcontextt Connectiontdestroy_contexttBackendcBseZdZRS(s- Base class for all backend plugins. (t__name__t __module__t__doc__(((s2/usr/lib/python2.6/site-packages/ipalib/backend.pyRst ConnectiblecBs\eZdZed„Zd„Zd„Zd„Zd„Zd„Z d„Z e e ƒZ RS(s$ Base class for backend plugins that create connections. In addition to the nicety of providing a standard connection API, all backend plugins that create connections should use this base class so that `request.destroy_context()` can properly close all open connections. cCsJti|ƒ|o|i|_n#d|itt|ƒƒf|_dS(Ns%s_%s(Rt__init__tnametidtstr(tselftshared_instance((s2/usr/lib/python2.6/site-packages/ipalib/backend.pyR .s cOs…tt|iƒo)td|itiƒiƒfƒ‚n|i||Ž}tt|it ||i ƒƒ|i d|iƒdS(s1 Create thread-local connection. s1connect: 'context.%s' already exists in thread %rsCreated connection context.%sN( thasattrRR t StandardErrort threadingt currentThreadtgetNametcreate_connectiontsetattrRt disconnecttdebug(Rtargstkwtconn((s2/usr/lib/python2.6/site-packages/ipalib/backend.pytconnect5s#cOstd|iƒ‚dS(Ns%s.create_connection()(tNotImplementedErrorR (RRR((s2/usr/lib/python2.6/site-packages/ipalib/backend.pyRDscCsntt|iƒp)td|itiƒiƒfƒ‚n|iƒtt|iƒ|i d|iƒdS(Ns4disconnect: 'context.%s' does not exist in thread %rsDestroyed connection context.%s( RRR RRRRtdestroy_connectiontdelattrR(R((s2/usr/lib/python2.6/site-packages/ipalib/backend.pyRGs# cCstd|iƒ‚dS(Ns%s.destroy_connection()(RR (R((s2/usr/lib/python2.6/site-packages/ipalib/backend.pyRRscCstt|iƒS(sY Return ``True`` if thread-local connection on `request.context` exists. (RRR (R((s2/usr/lib/python2.6/site-packages/ipalib/backend.pyt isconnectedUscCsOtt|iƒp)td|itiƒiƒfƒ‚ntt|iƒiS(s1 Return thread-local connection. sno context.%s in thread %r( RRR tAttributeErrorRRRtgetattrR(R((s2/usr/lib/python2.6/site-packages/ipalib/backend.pyt __get_conn[s#( RRR tTrueR RRRRR!t_Connectible__get_conntpropertyR(((s2/usr/lib/python2.6/site-packages/ipalib/backend.pyR %s      t ExecutionercBs)eZddd„Zd„Zd„ZRS(cCs¤|dj o|tidt j o1}|id|iit|ƒƒt ƒ}nXt ƒ|djo|S|‚dS(NR snon-public: %s: %ssunhandled exception: %s: %s( R/tCommandRRRt exceptiont __class__RRRt ExceptionR(Rt_nameRtoptionsterrortresultte((s2/usr/lib/python2.6/site-packages/ipalib/backend.pytexecute|s&   N(RRR/R6RR@(((s2/usr/lib/python2.6/site-packages/ipalib/backend.pyR(gs (R RtplugableR0terrorsRRRtrequestRRRtPluginRR R((((s2/usr/lib/python2.6/site-packages/ipalib/backend.pyts   B