| 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/ |
Upload File : |
ó
}9Rc @ sµ d Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d e
f d YZ d e
f d
YZ d Z
d Z d
Z d Z e j d Z d S( sĀ
Support code for the C{landscape-message} utility, which sends a text
message to the Landscape web UI via the landscape-client's dbus
messaging service (see L{landscape.plugins.dbus_message}).
i’’’’N( t log_failure( t LandscapeReactor( t RemoteBrokerConnector( t
Configurationt AcceptedTypeErrorc B s e Z d Z RS( sZ
Raised when a message is sent without 'text-message' being an
accepted type.
( t __name__t
__module__t __doc__( ( ( s9 /usr/lib/python2.7/dist-packages/landscape/textmessage.pyR s t EmptyMessageErrorc B s e Z d Z RS( s( Raised when an empty message is provied.( R R R ( ( ( s9 /usr/lib/python2.7/dist-packages/landscape/textmessage.pyR s c C s* i d d 6| d 6} | j | t } | S( s Add a message to the queue via a remote broker.
The message is of type C{text-message}.
@param broker: A connected L{RemoteBroker} object to use to send
the message.
@return: A L{Deferred} which will fire with the result of the send.
s text-messaget typet message( t send_messaget True( t textt brokerR
t response( ( s9 /usr/lib/python2.7/dist-packages/landscape/textmessage.pyR s c C s d GHd S( Nu
Message sent.( ( t result( ( s9 /usr/lib/python2.7/dist-packages/landscape/textmessage.pyt
got_result( s c C s t j j p d } t | d k rD d GHt j j j | } n/ d j g | d D] } | j | ^ qU } | s t d n | S( Ns UTF-8i sN Please enter your message, and send EOF (Control + D after newline) when done.u i s Text messages may not be empty.( t syst stdint encodingt lent readt decodet joinR ( t argsR R
t x( ( s9 /usr/lib/python2.7/dist-packages/landscape/textmessage.pyt get_message, s /c C sG d | k r t d n t | } t | | } | j t | S( Ns text-messagesR Text messages may not be created. Is Landscape Client registered with the server?( R R R t addCallbackR ( t accepted_typesR R R
t d( ( s9 /usr/lib/python2.7/dist-packages/landscape/textmessage.pyt got_accepted_types9 s
c s¦ t t } | j f d } d } t | j } | j | | j | | j f d | j f d j | S( s Send a message to Landscape.
This function runs a Twisted reactor, prints various status
messages, and exits the process.
c s | j } | j t | S( N( t get_accepted_message_typesR R ( R R ( R ( s9 /usr/lib/python2.7/dist-packages/landscape/textmessage.pyt got_connectionM s c S s t | d S( N( R ( t failure( ( s9 /usr/lib/python2.7/dist-packages/landscape/textmessage.pyt got_errorQ s c s
j S( N( t
disconnect( R ( t connector( s9 /usr/lib/python2.7/dist-packages/landscape/textmessage.pyt <lambda>X s c s j d j j S( Ni ( t
call_latert _reactort stop( t ignored( t reactor( s9 /usr/lib/python2.7/dist-packages/landscape/textmessage.pyR&