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/server.pyc
ó
}9Rc@soddlZddlmZddlmZddlmZddlmZd„Z	de
fd„ƒYZdS(	iÿÿÿÿN(tDeferred(tgather_results(tremote(tFAILEDcs(|jjddƒ‰‡fd†}|S(s&Turns a L{BrokerServer} method into an event broadcaster.

    When the decorated method is called, an event is fired on all connected
    clients. The event will have the same name as the method being called,
    except that any underscore in the method name will be replaced with a dash.
    t_t-csCg}x0|jƒD]"}|j|jˆ||ŽƒqWt|ƒS(N(tget_clientstappendt
fire_eventR(tselftargstkwargstfiredtclient(t
event_type(s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pytbroadcast_events (t__name__treplace(tmethodR((Rs;/usr/lib/python2.7/dist-packages/landscape/broker/server.pytevent
stBrokerServercBs‚eZdZdZd„Zed„ƒZed„ƒZd„Zd„Z	d„Z
d„Zeed	„ƒZ
ed
„ƒZed„ƒZed„ƒZed
„ƒZed„ƒZed„ƒZed„ƒZed„ƒZed„ƒZed„ƒZed„ƒZed„ƒZed„ƒZed„ƒZed„ƒZed„ƒZd„Zd„Z ed„ƒZ!RS(s©
    A broker server capable of handling messages from plugins connected using
    the L{BrokerProtocol}.

    @param config: The L{BrokerConfiguration} used by the broker.
    @param reactor: The L{LandscapeReactor} driving the broker's events.
    @param exchange: The L{MessageExchange} to send messages with.
    @param registration: The {RegistrationHandler}.
    @param message_store: The broker's L{MessageStore}.
    tbrokercCsÚddlm}|ƒ|_||_||_||_||_||_i|_i|_	||_
|jd|jƒ|jd|j
ƒ|jd|jƒ|jd|jƒ|jd|jƒ|jd|jƒdS(	Niÿÿÿÿ(tget_component_registrytmessagesimpending-exchangesmessage-type-acceptance-changedsserver-uuid-changedspackage-data-changedsresynchronize-clients(tlandscape.broker.ampRtconnectors_registryt_configt_reactort
_exchangert
_registrationt_message_storet_registered_clientst_connectorst_pingertcall_ontbroadcast_messagetimpending_exchangetmessage_type_acceptance_changedtserver_uuid_changedtpackage_data_changedt
resynchronize(R	tconfigtreactortexchangetregistrationt
message_storetpingerR((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyt__init__)s"									
cCstS(sReturn C{True}.(tTrue(R	((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pytping>scsUˆjjˆƒ}|ˆjˆjƒ‰‡‡‡fd†}ˆjƒ}|j|ƒS(sRRegister a broker client called C{name}.

        Various broker clients interact with the broker server, such as the
        monitor for example, using the L{BrokerServerConnector} for performing
        remote method calls on the L{BrokerServer}.

        They establish connectivity with the broker by connecting and
        registering themselves, the L{BrokerServer} will in turn connect
        to them in order to be able to perform remote method calls like
        broadcasting events and messages.

        @param name: The name of the client, such a C{monitor} or C{manager}.
        cs|ˆjˆ<ˆˆj|<dS(N(RR (t
remote_client(t	connectorR	tname(s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pytregisterUs
(RtgetRRtconnecttaddCallback(R	R4tconnector_classR5t	connected((R4R	R3s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pytregister_clientCs
cCs
|jjƒS(s5Get L{RemoteClient} instances for registered clients.(Rtvalues(R	((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyR\scCs|jj|ƒS(s4Return the client with the given C{name} or C{None}.(RR6(R	R4((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyt
get_client`scCs
|jjƒS(saGet connectors for registered clients.

        @see L{RemoteLandscapeComponentCreator}.
        (R R<(R	((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pytget_connectorsdscCs|jj|j|ƒƒS(s6Return the connector for the given C{name} or C{None}.(R R6R=(R	R4((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyt
get_connectorkscCs|jj|d|ƒS(s³Queue C{message} for delivery to the server at the next exchange.

        @param message: The message C{dict} to send to the server.  It must
            have a C{type} key and be compatible with C{landscape.lib.bpickle}.
        @param urgent: If C{True}, exchange urgently, otherwise exchange
            during the next regularly scheduled exchange.
        @return: The message identifier created when queuing C{message}.
        turgent(Rtsend(R	RR@((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pytsend_messageos
cCs|jj|ƒS(s:Indicate if a message with given C{message_id} is pending.(Rt
is_pending(R	t
message_id((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pytis_message_pending{scCsRg}x'|jƒD]}|j|jƒƒqWt|dtƒ}|jd„ƒS(sTell all the clients to exit.tconsume_errorscSsdS(N(tNone(tignored((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyt<lambda>ˆs(RRtexitRR0R8(R	tresultsR
tresult((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pytstop_clients€s
cCs|jjƒ|jƒS(s4Reload the configuration file, and stop all clients.(RtreloadRM(R	((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pytreload_configurationŠs
cCs
|jjƒS(sfAttempt to register with the Landscape server.

        @see: L{RegistrationHandler.register}
        (RR5(R	((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyR5’scCs
|jjƒS(s:Return the message types accepted by the Landscape server.(Rtget_accepted_types(R	((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pytget_accepted_message_typesšscCs
|jjƒS(s:Return the uuid of the Landscape server we're pointing at.(Rtget_server_uuid(R	((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyRRŸscCs|jj|ƒdS(s|Register a new message type which can be accepted by this client.

        @param type: The message type to accept.
        N(Rt%register_client_accepted_message_type(R	ttype((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyRS¤scCs|jj|ƒdS(s$Fire an event in the broker reactor.N(Rtfire(R	R((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyR¬scs(ˆjƒ}‡fd†}|j|ƒS(s“Request a graceful exit from the broker server.

        Before this method returns, all broker clients will be notified
        of the server broker's intention of exiting, so that they have
        the chance to stop whatever they're doing in a graceful way, and
        then exit themselves.

        This method will only return a result when all plugins returned
        their own results.
        cs ˆjjd‡fd†ƒdS(Nics
ˆjjƒS(N(Rtstop((R	(s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyRIÇs(Rt
call_later(RH(R	(s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pytschedule_reactor_stop¿s(RMtaddBoth(R	tclients_stoppedRX((R	s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyRJ±s
cCsdS(s2Broadcast a C{resynchronize} event to the clients.N((R	((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyR(ËscCsdS(s8Broadcast an C{impending-exchange} event to the clients.N((R	((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyR$Ïscsatƒ‰g‰‡‡‡fd†}x6|D].}ˆjj|||ƒƒ}ˆj|ƒq+WˆS(sk
        Return a C{Deferred} that fires when the first event occurs among the
        given ones.
        cs‡‡‡‡fd†}|S(Ncs2xˆD]}ˆjj|ƒqWˆjˆƒdS(N(Rtcancel_calltcallback(tcall(tdeferredR	Rtcalls(s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pythandlerÞs
((RR`(R^R	R_(Rs;/usr/lib/python2.7/dist-packages/landscape/broker/server.pytget_handlerÜs(RRR"R(R	tevent_typesRaRR]((R_R	R^s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyt
listen_eventsÓs		
cCsdS(s5Broadcast a C{broker-reconnect} event to the clients.N((R	((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pytbroker_reconnectêscCsdS(s8Broadcast a C{server-uuid-changed} event to the clients.N((R	told_uuidtnew_uuid((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyR&îscCsdS(N((R	RTtaccepted((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyR%òscCsdS(s@Fire a package-data-changed event in the reactor of each client.N((R	((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyR'öscCsRg}x*|jƒD]}|j|j|ƒƒqWt|ƒ}|j|j|ƒS(seCall the C{message} method of all the registered plugins.

        @see: L{register_plugin}.
        (RRRRR8t_message_delivered(R	RRKR
RL((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyR#ús
cCs¡|jdƒ}t|kr|d
k	r|ddkr|d}tjd|fƒd|f}idd6td6|d6|d6}|jj|d	tƒnd
S(s¾
        If the message wasn't handled, and it's an operation request (i.e. it
        has an operation-id), then respond with a failing operation result
        indicating as such.
        soperation-idRTR(sNobody handled the %s message.s4Landscape client failed to handle this request (%s) because the
plugin which should handle it isn't available.  This could mean that the
plugin has been intentionally disabled, or that the client isn't running
properly, or you may be running an older version of the client that doesn't
support this feature.
soperation-resulttstatussresult-textR@N(R6R0RGtloggingterrorRRRA(R	RKRtopidtmtypetresult_texttresponse((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyRhs


cCs|jjƒ|jjƒdS(s
        Stop exchaging messages with the message server.

        Eventually, it is required by the plugin that no more message exchanges
        are performed.
        For example, when a reboot process in running, the client stops
        accepting new messages so that no client action is running while the
        machine is rebooting.
        Also, some activities should be explicitly require that no more
        messages are exchanged so some level of serialization in the client
        could be achieved.
        N(RRVR!(R	((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pytstop_exchanger s
("Rt
__module__t__doc__R4R/RR1R;RR=R>R?tFalseRBRERMROR5RQRRRSRRJRR(R$RcRdR&R%R'R#RhRp(((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyRs<
					
		(Rjttwisted.internet.deferRtlandscape.lib.twisted_utilRt
landscape.ampRtlandscape.manager.managerRRtobjectR(((s;/usr/lib/python2.7/dist-packages/landscape/broker/server.pyt<module>s	

Youez - 2016 - github.com/yon3zu
LinuXploit