Current File : //lib/python2.7/site-packages/cloudinit/distros/opensuse.pyc
�
oB�]c@s�ddlmZddlmZddlmZddlmZddlmZddlm	Z
ddlmZej
e�Zdejfd	��YZd
S(i����(tdistros(tHostnameConf(thelpers(tlog(tutil(t	rhel_util(tPER_INSTANCEtDistrocBseZdZdZdgZdZdZdZdZdZ	dZ
d	Zd
Ziidd6d
d6dd6idd6dd6d6d6Z
d�Zd#d�Zd�Zd#d#d�Zd�Zd�Zd�Zd#d�Zd�Zd�Zd �Zd!�Zed"��ZRS($s/etc/sysconfig/clocks
/etc/HOSTNAMEtservices/etc/sysconfig/languages/etc/sysconfig/network/configs/etc/sysconfig/network/ifcfg-%ss/etc/resolv.confs!/etc/sysconfig/network/ifroute-%ss
/etc/hostnames/etc/locale.confs/etc/localtimesetc/sysconfig/network/configtcontrols%(base)s/network/ifcfg-%(name)stiface_templatess3etc/udev/rules.d/85-persistent-net-cloud-init.rulest
netrules_paths!%(base)s/network/ifroute-%(name)stipv4tipv6troute_templatest	sysconfigcCsgtjj||||�tj|�|_d|_d|d<|j�rcdg|_d|d<ndS(Ntsusetsshdtssh_svcnamet	systemctlssshd.service(	RRt__init__RtRunnerst_runnertosfamilytuses_systemdtinit_cmd(tselftnametcfgtpaths((s>/usr/lib/python2.7/site-packages/cloudinit/distros/opensuse.pyR2s	
cCsa|j�r.|s|j}ni|d6}n|s@|j}ni|d6}tj||�dS(NtLANGtRC_LANG(Rtsystemd_locale_conf_fntlocale_conf_fntrhutiltupdate_sysconfig_file(Rtlocaletout_fnt
locale_cfg((s>/usr/lib/python2.7/site-packages/cloudinit/distros/opensuse.pytapply_locale;s
cCs|jdddd|�dS(Ntinstalltargss--auto-agree-with-licensestpkgs(tpackage_command(Rtpkglist((s>/usr/lib/python2.7/site-packages/cloudinit/distros/opensuse.pytinstall_packagesFscCs�|dkrg}nddg}|dkr6d}n|j|�|rht|t�rh|j|�n%|r�t|t�r�|j|�ntjd|�}|j|�tj|dt	�dS(Ntzyppers--non-interactivetupgradetupdates%s-%stcapture(
tNonetappendt
isinstancetstrtlisttextendRtexpand_package_listtsubptFalse(RtcommandR)R*tcmdR,((s>/usr/lib/python2.7/site-packages/cloudinit/distros/opensuse.pyR+Ms		

cCs~|j|�}|j�rAtj|j�tj||j�n9it|�d6}tj|j	|�tj
||j�dS(NtTIMEZONE(t
_find_tz_fileRRtdel_filettz_local_fntsym_linkR5R"R#t
clock_conf_fntcopy(Rttzttz_filet	clock_cfg((s>/usr/lib/python2.7/site-packages/cloudinit/distros/opensuse.pytset_timezoneescCs&|jjd|jdgdt�dS(Nsupdate-sourcestrefreshtfreq(RtrunR+R(R((s>/usr/lib/python2.7/site-packages/cloudinit/distros/opensuse.pytupdate_package_sourcesuscCs;|r(d|kr(td|j��ntjj||�S(Ntalls1Distro %s can not translate the device name "all"(tRuntimeErrorRRRt_bring_up_interfaces(Rtdevice_names((s>/usr/lib/python2.7/site-packages/cloudinit/distros/opensuse.pyRNyscCs�|j�r.|jd�r.tj|�j�S|j�ritjdg�\}}t|�rb|S|Sn>y|j|�}|j}Wnt	k
r�nX|s�|S|SdS(Ns/previous-hostnamethostname(
RtendswithRt	load_filetstripR9tlent_read_hostname_confRPtIOError(Rtfilenametdefaulttoutt_errtconfRP((s>/usr/lib/python2.7/site-packages/cloudinit/distros/opensuse.pyt_read_hostnames

cCs#ttj|��}|j�|S(N(RRRRtparse(RRWR[((s>/usr/lib/python2.7/site-packages/cloudinit/distros/opensuse.pyRU�s
cCs4|j�r|j}n	|j}||j|�fS(N(Rtsystemd_hostname_conf_fnthostname_conf_fnR\(Rthost_fn((s>/usr/lib/python2.7/site-packages/cloudinit/distros/opensuse.pyt_read_system_hostname�s	cCs�|j�r.|jd�r.tj||�n�|j�rYtjddt|�g�nhd}y|j|�}Wntk
r�nX|s�t	d�}n|j
|�tj|t|�d�dS(Ns/previous-hostnamethostnamectlsset-hostnameti�(RRQRt
write_fileR9R5R2RURVRtset_hostname(RRPR%R[((s>/usr/lib/python2.7/site-packages/cloudinit/distros/opensuse.pyt_write_hostname�s

cCs
|j|�S(N(t_supported_write_network_config(Rt	netconfig((s>/usr/lib/python2.7/site-packages/cloudinit/distros/opensuse.pyt_write_network_config�scCs�|js�tj�d}|d}t|djd�d�}|dkrXd|ks||dkr�d|kr�|dkr�dd	d
g|_q�d
d	dg|_n|jS(s5The preferred ntp client is dependent on the version.tdistiit.itopenSUSEi*tchronyssystemd-timesyncdtntp(t_preferred_ntp_clientsRtsystem_infotinttsplit(Rtdistro_infoRt	major_ver((s>/usr/lib/python2.7/site-packages/cloudinit/distros/opensuse.pytpreferred_ntp_clients�s	
$N(t__name__t
__module__RBR_RR!tnetwork_conf_fntnetwork_script_tpltresolve_conf_fntroute_conf_tplR^R R@trenderer_configsRR2R'R-R+RGRKRNR\RURaRfRitpropertyRu(((s>/usr/lib/python2.7/site-packages/cloudinit/distros/opensuse.pyRs@											N(t	cloudinitRt"cloudinit.distros.parsers.hostnameRRRtloggingRtcloudinit.distrosRR"tcloudinit.settingsRt	getLoggerRvtLOGR(((s>/usr/lib/python2.7/site-packages/cloudinit/distros/opensuse.pyt<module>s