Viewing File: /usr/lib/python2.7/site-packages/cloudinit/distros/parsers/hostname.pyo

ó
oBú]c@s:ddlmZddlmZdefd„ƒYZdS(iÿÿÿÿ(tStringIO(tchop_commenttHostnameConfcBsDeZd„Zd„Zd„Zed„ƒZd„Zd„ZRS(cCs||_d|_dS(N(t_texttNonet	_contents(tselfttext((sF/usr/lib/python2.7/site-packages/cloudinit/distros/parsers/hostname.pyt__init__s	cCs+|jdkr'|j|jƒ|_ndS(N(RRt_parseR(R((sF/usr/lib/python2.7/site-packages/cloudinit/distros/parsers/hostname.pytparsescCsÓ|jƒtƒ}x‘|jD]†\}}|dkrM|jd|dƒq|dkrq|jd|dƒq|dkr|\}}|jd||fƒqqW|jƒ}|jdƒsÏ|d7}n|S(Ntblanks%s
itall_commentthostnames%s%s
s
(R
RRtwritetgetvaluetendswith(Rtcontentst	line_typet
componentsR
ttail((sF/usr/lib/python2.7/site-packages/cloudinit/distros/parsers/hostname.pyt__str__s
	
cCs<|jƒx+|jD] \}}|dkr|dSqWdS(NR
i(R
RR(RRR((sF/usr/lib/python2.7/site-packages/cloudinit/distros/parsers/hostname.pyR
's

cCs”|jƒ}|sdS|jƒt}x<|jD]1\}}|dkr0t|ƒ|d<t}q0q0W|s|jjdt|ƒdgfƒndS(NR
it(tstripR
tFalseRtstrtTruetappend(Rt
your_hostnametreplacedRR((sF/usr/lib/python2.7/site-packages/cloudinit/distros/parsers/hostname.pytset_hostname/s

cCsæg}tƒ}x«|jƒD]}t|jƒƒsP|jd|gfƒqnt|jƒdƒ\}}t|ƒs“|jd|gfƒqn|jd||gfƒ|j|ƒqWt|ƒdkrâtd|ƒ‚n|S(NRt#RR
isMultiple hostnames (%s) found!(tsett
splitlinestlenRRRtaddtIOError(RRtentriesthostnames_foundtlinetheadR((sF/usr/lib/python2.7/site-packages/cloudinit/distros/parsers/hostname.pyR	<s 	
(	t__name__t
__module__RR
RtpropertyR
RR	(((sF/usr/lib/python2.7/site-packages/cloudinit/distros/parsers/hostname.pyR
s				
N(tsixRtcloudinit.distros.parsersRtobjectR(((sF/usr/lib/python2.7/site-packages/cloudinit/distros/parsers/hostname.pyt<module>s
Back to Directory File Manager