Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/landscape/monitor/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/landscape/monitor/plugin.pyc

ó
ÍÿŠTc@s€ddlmZddlmZddlmZddlmZddlm	Z	de	fd„ƒYZ
de
fd	„ƒYZd
S(iÿÿÿÿ(tinfo(tsucceed(t
format_object(tlog_failure(tBrokerClientPlugint
MonitorPlugincBsJeZdZdZdZd„Zd„Zed„ƒZ	ed„ƒZ
RS(sy
    @cvar persist_name: If specified as a string, a C{_persist} attribute
    will be available after registration.
    cCsPtt|ƒj|ƒ|jdk	rC|jjj|jƒ|_n	d|_dS(N(	tsuperRtregistertpersist_nametNonetmonitortpersisttroot_att_persist(tselfR
((s</usr/lib/python2.7/dist-packages/landscape/monitor/plugin.pyRscCs,|jdk	r(|jjj|jƒndS(N(RR	tregistryRtremove(R((s</usr/lib/python2.7/dist-packages/landscape/monitor/plugin.pyt_resetscCs|jS(sReturn our L{Persist}, if any.(R
(R((s</usr/lib/python2.7/dist-packages/landscape/monitor/plugin.pyRscCs|jS(s%An alias for the C{client} attribute.(tclient(R((s</usr/lib/python2.7/dist-packages/landscape/monitor/plugin.pyR
#sN(t__name__t
__module__t__doc__R	RtscopeRRtpropertyRR
(((s</usr/lib/python2.7/dist-packages/landscape/monitor/plugin.pyR
s		tDataWatchercBsAeZdZdZdZd„Zd„Zd„Ze	d„Z
RS(sY
    A utility for plugins which send data to the Landscape server
    which does not constantly change. New messages will only be sent
    when the result of get_data() has changed since the last time it
    was called.

    Subclasses should provide a get_data method, and message_type,
    message_key, and persist_name class attributes.
    cCsS|jƒ}|jjdƒ|krO|jjd|ƒi|jd6||j6SdS(s}
        Construct a message with the latest data, or None, if the data
        has not changed since the last call.
        tdatattypeN(tget_dataR
tgettsettmessage_typetmessage_key(RR((s</usr/lib/python2.7/dist-packages/landscape/monitor/plugin.pytget_message7scsƒˆjƒ}|dk	rytdtˆƒƒˆjjj|ˆjd|ƒ}‡fd†}|j|ƒ|j	t
ƒ|StdƒS(Ns9Queueing a message with updated data watcher info for %s.turgentcsˆjƒdS(N(tpersist_data(t
message_id(R(s</usr/lib/python2.7/dist-packages/landscape/monitor/plugin.pyR"Is(R R	RRRtbrokertsend_messaget_session_idtaddCallbackt
addErrbackRR(RR!tmessagetresultR"((Rs</usr/lib/python2.7/dist-packages/landscape/monitor/plugin.pyR%As


cCsdS(ss
        Sub-classes that need to defer the saving of persistent data
        should override this method.
        N((R((s</usr/lib/python2.7/dist-packages/landscape/monitor/plugin.pyR"QscCs|jjj|j|j|ƒS(sd
        Conditionally add a message to the message store if new data
        is available.
        (RR$tcall_if_acceptedRR%(RR!((s</usr/lib/python2.7/dist-packages/landscape/monitor/plugin.pytexchangeXsN(RRRR	RRR R%R"tFalseR,(((s</usr/lib/python2.7/dist-packages/landscape/monitor/plugin.pyR)s		
		N(tloggingRttwisted.internet.deferRt
landscape.logRtlandscape.lib.logRtlandscape.broker.clientRRR(((s</usr/lib/python2.7/dist-packages/landscape/monitor/plugin.pyt<module>s