403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/landscape/broker/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/landscape/broker/client.pyc
ó
}9Rc@sœddlmZmZddlmZddlmZddlmZddl	m
Z
defd„ƒYZde
fd	„ƒYZd
e
fd„ƒYZdS(
iÿÿÿÿ(tinfot	exception(t
maybeDeferred(t
format_object(tgather_results(tremotetHandlerNotFoundErrorcBseZdZRS(s3A handler for the given message type was not found.(t__name__t
__module__t__doc__(((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pyR
stBrokerClientPlugincBs;eZdZdZeZd„Zed„ƒZd„Z	RS(sA convenience for writing L{BrokerClient} plugins.

    This provides a register method which will set up a bunch of
    reactor handlers in the idiomatic way.

    If C{run} is defined on subclasses, it will be called every C{run_interval}
    seconds after being registered.

    @cvar run_interval: The interval, in seconds, to execute the C{run} method.
        If set to C{None}, then C{run} will not be scheduled.
    @cvar run_immediately: If C{True} the plugin will be run immediately after
        it is registered.
    icCsl||_t|ddƒdk	rh|jr7|jƒn|jdk	rh|jjj|j|jƒqhndS(Ntrun(tclienttgetattrtNonetrun_immediatelyRtrun_intervaltreactort
call_every(tselfR((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pytregister s		
cCs|jS(s%An alias for the C{client} attribute.(R(R((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pytregistry(scs5‡‡‡fd†}|jjjd|f|ƒdS(sV
        Register a callback fired upon a C{message-type-acceptance-changed}.
        cs|rˆˆˆŽSdS(N((t
acceptance(tcallabletargstkwargs(s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pytacceptance_changed2ssmessage-type-acceptance-changedN(RRtcall_on(RttypeRRRR((RRRs;/usr/lib/python2.7/dist-packages/landscape/broker/client.pytcall_on_accepted-s(
RRR	RtFalseRRtpropertyRR(((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pyR
s
	tBrokerClientcBs¡eZdZdZd„Zed„ƒZd„Zd„Zd„Z	d„Z
d„Zed	„ƒZd
„Z
d„Zed„ƒZd
„Zed„ƒZRS(sBasic plugin registry for clients that have to deal with the broker.

    This knows about the needs of a client when dealing with the Landscape
    broker, including interest in messages of a particular type delivered
    by the broker to the client.

    @cvar name: The name used when registering to the broker, it must be
        defined by sub-classes.
    @ivar broker: A reference to a connected L{RemoteBroker}, it must be set
        by the connecting machinery at service startup.

    @param reactor: A L{LandscapeReactor}.
    RcCsptt|ƒjƒ||_d|_i|_g|_i|_|jj	d|j
ƒ|jj	d|jƒdS(Nsimpending-exchangesbroker-reconnect(tsuperR t__init__RRtbrokert_registered_messagest_pluginst
_plugin_namesRtnotify_exchangethandle_reconnect(RR((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pyR"Js					cCstS(sReturn C{True}(tTrue(R((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pytpingVscCsVtdt|ƒƒ|jj|ƒt|dƒrE||j|j<n|j|ƒdS(sAdd a plugin.

        The plugin's C{register} method will be called with this broker client
        as its argument.

        If the plugin has a C{plugin_name} attribute, it will be possible to
        look up the plugin later with L{get_plugin}.
        sRegistering plugin %s.tplugin_nameN(RRR%tappendthasattrR&R+R(Rtplugin((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pytadd[s
	cCs|jS(sGet the list of plugins.(R%(R((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pytget_pluginsjscCs|j|S(s Get a particular plugin by name.(R&(Rtname((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pyt
get_pluginnscCs||j|<|jj|ƒS(st
        Register interest in a particular type of Landscape server->client
        message.

        @param type: The type of message to register C{handler} for.
        @param handler: A callable taking a message as a parameter, called
            when messages of C{type} are received.
        @return: A C{Deferred} that will fire when registration completes.
        (R$R#t%register_client_accepted_message_type(RRthandler((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pytregister_messagers

cCsg|d}|jj|ƒ}|dkr7t|ƒ‚ny||ƒSWntd||fƒnXdS(sÆRun the handler registered for the type of the given message.

        @return: The return value of the handler, if found.
        @raises: HandlerNotFoundError if the handler was not found
        Rs-Error running message handler for type %r: %rN(R$tgetRRR(RtmessageRR4((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pytdispatch_messages
cCs.y|j|ƒtSWntk
r)tSXdS(sŠCall C{dispatch_message} for the given C{message}.

        @return: A boolean indicating if a handler for the message was found.
        N(R8R)RR(RR7((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pyR7s


cCsOxH|jƒD]:}t|dƒr
y|jƒWqGtdƒqGXq
q
WdS(s Call C{exchange} on all plugins.texchangesError during plugin exchangeN(R0R-R9R(RR.((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pyR9›scCstdƒ|jƒdS(s/Notify all plugins about an impending exchange.s>Got notification of impending exchange. Notifying all plugins.N(RR9(R((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pyR'¤s
cOs|dkr>|d}|d}|jj||f|ƒ}n|jj|||Ž}tg|D]}td„|ƒ^q`ƒS(s´Fire an event of a given type.

        @return: A L{Deferred} resulting in a list of returns values of
            the fired event handlers, in the order they were fired.
        smessage-type-acceptance-changediicSs|S(N((tx((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pyt<lambda>·s(RtfireRR(Rt
event_typeRRtmessage_typeRtresultstresult((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pyt
fire_event©s

cCs;x!|jD]}|jj|ƒq
W|jj|jƒdS(sCalled when the connection with the broker is established again.

        The following needs to be done:

          - Re-register any previously registered message types, so the broker
            knows we have interest on them.

          - Re-register ourselves as client, so the broker knows we exist and
            will talk to us firing events and dispatching messages.
        N(R$R#R3tregister_clientR1(RR((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pyR(¹scCs|jjd|jjƒdS(s&Stop the reactor and exit the process.gš™™™™™¹?N(Rt
call_latertstop(R((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pytexitÈs(RRR	R1R"RR*R/R0R2R5R8R7R9R'RAR(RE(((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pyR :s
					
					N(tloggingRRttwisted.internet.deferRt
landscape.logRtlandscape.lib.twisted_utilRt
landscape.ampRt	ExceptionRtobjectR
R (((s;/usr/lib/python2.7/dist-packages/landscape/broker/client.pyt<module>s,

Youez - 2016 - github.com/yon3zu
LinuXploit