ó oBú]c@sœddlmZddlmZddlmZddlmZddlmZddlm Z ddl m Z ej eƒZdejfd „ƒYZd S( iÿÿÿÿ(tdistros(t HostnameConf(thelpers(tlog(tutil(t rhel_util(t PER_INSTANCEtDistrocBs eZdZdZdgZdZdZdZdZdZ dZ d Z d Z iid d 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/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%|rt|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_filet tz_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-hostnamet hostnamectls 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_clientsRt system_infotinttsplit(Rt distro_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 s