Your IP : 172.28.240.42


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

ó
ÍÿŠTc@sBdZddlZdefd„ƒYZdefd„ƒYZdS(sDProgrammatically manage the Landscape client SysV-style init script.iÿÿÿÿNtProcessErrorcBseZdZRS(s) Error running a process with os.system. (t__name__t
__module__t__doc__(((s8/usr/lib/python2.7/dist-packages/landscape/sysvconfig.pyRst
SysVConfigcBsPeZdZdd„Zd„Zd„Zd„Zd„Zd„Zd„Z	RS(	s…Configure and drive the Landscape client init script.

    @param filename: Path to the file holding init scripts env variables.
    s/etc/default/landscape-clientcCs
||_dS(N(t	_filename(tselftfilename((s8/usr/lib/python2.7/dist-packages/landscape/sysvconfig.pyt__init__scCs3|jƒ}|rdpd|d<|j|ƒdS(s>Make the init script decide to start the client when it's run.iitRUNN(t_parse_filet_write_file(Rtflagtcurrent((s8/usr/lib/python2.7/dist-packages/landscape/sysvconfig.pytset_start_on_bootscCs"tjdƒrtdƒ‚ndS(s%Restart the Landscape client service.s$/etc/init.d/landscape-client restartsCould not restart clientN(tostsystemR(R((s8/usr/lib/python2.7/dist-packages/landscape/sysvconfig.pytrestart_landscapescCs"tjdƒrtdƒ‚ndS(s"Stop the Landscape client service.s!/etc/init.d/landscape-client stopsCould not stop clientN(RRR(R((s8/usr/lib/python2.7/dist-packages/landscape/sysvconfig.pytstop_landscapescCs9|jƒ}|jddƒ}|d jƒo8|dkS(sç
        Return a boolean representing whether the init script will decide to
        actually start the client when it is run.  This method should match
        the semantics of the checks in debian/landscape-client.init.
        R	t0i(R
tgettisspace(Rtstatet	run_value((s8/usr/lib/python2.7/dist-packages/landscape/sysvconfig.pytis_configured_to_run#scCsyi}tjj|jƒruxWt|jdƒD]@}|jƒ}d|kr.|jdƒ\}}|||<q.q.Wn|S(Ntrt=(RtpathtisfileRtopentstriptsplit(Rtvaluestlinetkeytvalue((s8/usr/lib/python2.7/dist-packages/landscape/sysvconfig.pyR
-scCs^t|jdƒ}x;t|jƒƒD]'}|jd|t||ƒfƒq%W|jƒdS(Ntws%s=%s
(RRtsortedtkeystwritetstrtclose(RR tfileR"((s8/usr/lib/python2.7/dist-packages/landscape/sysvconfig.pyR8s%(
RRRRRRRRR
R(((s8/usr/lib/python2.7/dist-packages/landscape/sysvconfig.pyR
s				
	(RRt	ExceptionRtobjectR(((s8/usr/lib/python2.7/dist-packages/landscape/sysvconfig.pyt<module>s