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/manager/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pyc
ó
}9Rc@sžddlZddlmZddlmZddlmZddlmZm	Z	m
Z
defd„ƒYZdefd	„ƒYZ
d
efd„ƒYZdS(iÿÿÿÿN(tDeferred(tProcessProtocol(tProcessDone(t
ManagerPlugint	SUCCEEDEDtFAILEDtShutdownFailedErrorcBseZdZd„ZRS(svRaised when a call to C{/sbin/shutdown} fails.

    @ivar data: The data that the process printed before failing.
    cCs
||_dS(N(tdata(tselfR((sE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pyt__init__s(t__name__t
__module__t__doc__R	(((sE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pyR
stShutdownManagercBsJeZdd„Zd„Zd„Zd„Zd„Zd„Zd„Z	RS(cCs,|dkrddlm}n||_dS(Niÿÿÿÿ(treactor(tNonettwisted.internetRt_process_factory(Rtprocess_factory((sE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pyR	scCs-tt|ƒj|ƒ|jd|jƒdS(sAdd this plugin to C{registry}.

        The shutdown manager handles C{shutdown} activity messages broadcast
        from the server.
        tshutdownN(tsuperR
tregistertregister_messagetperform_shutdown(Rtregistry((sE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pyRscCs‘|d}|d}tƒ}|j|jjƒ|jj|j|ƒ|jj|j|ƒ|j	||ƒ\}}|j
j||d|ƒdS(sîRequest a system restart or shutdown.

        If the call to C{/sbin/shutdown} runs without errors the activity
        specified in the message will be responded as succeeded.  Otherwise,
        it will be responded as failed.
        soperation-idtreboottargsN(tShutdownProcessProtocoltset_timeoutRRtresulttaddCallbackt_respond_successt
addErrbackt_respond_failuret_get_command_and_argsRtspawnProcess(Rtmessagetoperation_idRtprotocoltcommandR((sE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pyR$s

	cs<tjdƒˆjt||ƒ}|j‡fd†ƒ|S(NsShutdown request succeeded.csˆjjjƒS(N(Rtbrokertstop_exchanger(t_(R(sE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pyt<lambda>:s(tloggingtinfot_respondRR(RRR%tdeferred((RsE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pyR4s

cCs&tjdƒ|jt|jj|ƒS(NsShutdown request failed.(R,R-R.RtvalueR(RtfailureR%((sE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pyR!=s
cCs8idd6|d6|d6|d6}|jjj|tƒS(Nsoperation-resultttypetstatussresult-textsoperation-id(RR(tsend_messagetTrue(RR3RR%R$((sE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pyR.As


cCsKd|jdf}|r/dd|dg}ndd|dg}d|fS(ss
        Returns a C{command, args} 2-tuple suitable for use with
        L{IReactorProcess.spawnProcess}.
        s+%di<s/sbin/shutdowns-rs!Landscape is rebooting the systems-hs%Landscape is shutting down the system(tdelay(RR&RtminutesR((sE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pyR"Hs			N(
R
RRR	RRRR!R.R"(((sE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pyR
s							RcBsMeZdZedd„Zd„Zdd„Zd„Zd„Zd„Z	RS(	s~A ProcessProtocol for calling C{/sbin/shutdown}.

    C{shutdown} doesn't return immediately when a time specification is
    provided.  Failures are reported immediately after it starts and return a
    non-zero exit code.  The process protocol calls C{shutdown} and waits for
    failures for C{timeout} seconds.  If no failures are reported it fires
    C{result}'s callback with whatever output was received from the process.
    If failures are reported C{result}'s errback is fired.

    @ivar result: A L{Deferred} fired when C{shutdown} fails or
        succeeds.
    @ivar reboot: A flag indicating whether a shutdown or reboot should be
        performed.  Default is C{False}.
    @ivar delay: The time in seconds from now to schedule the shutdown.
        Default is 240 seconds.  The time will be converted to minutes using
        integer division when passed to C{shutdown}.
    iðcCs4tƒ|_||_||_g|_t|_dS(N(RRRR6t_dataR5t_waiting(RRR6((sE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pyR	js
			cCsdj|jƒS(s'Get the data printed by the subprocess.t(tjoinR8(R((sE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pytget_dataqsi
cCs|j||jƒdS(si
        Set the error checking timeout, after which C{result}'s callback will
        be fired.
        N(t
call_latert_succeed(RRttimeout((sE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pyRuscCs |jr|jj|ƒndS(ssSome data was received from the child.

        Add it to our buffer to pass to C{result} when it's fired.
        N(R9R8tappend(RtfdR((sE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pytchildDataReceived|s	cCsQ|jrM|jtƒr%|jƒqM|jjt|jƒƒƒt|_ndS(sFire back the C{result} L{Deferred}.

        C{result}'s callback will be fired with the string of data received
        from the subprocess, or if the subprocess failed C{result}'s errback
        will be fired with the string of data received from the subprocess.
        N(	R9tcheckRR>RterrbackRR<tFalse(Rtreason((sE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pytprocessEnded„s
	
cCs/|jr+|jj|jƒƒt|_ndS(sAFire C{result}'s callback with data accumulated from the process.N(R9RtcallbackR<RE(R((sE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pyR>’s	(
R
RRRER	R<RRBRGR>(((sE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pyRWs			(R,ttwisted.internet.deferRttwisted.internet.protocolRttwisted.internet.errorRtlandscape.manager.pluginRRRt	ExceptionRR
R(((sE/usr/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.pyt<module>s
C

Youez - 2016 - github.com/yon3zu
LinuXploit