jbc@sddlZddlZddlZddlmZddlmZddlmZddlm Z ddl m Z ddl m Z dd lmZmZmZmZejeZd Zd d d dgZddZdZdZdZdefdYZdefdYZdefdYZde j fdYZ dZ!e"dZ#e"dZ$e"dZ%dS( iN(tnetworkmanager_conf(t resolv_conf(tlog(tutil(t ConfigObji(trenderer(t is_ipv6_addrtnet_prefix_to_ipv4_masktsubnet_is_ipv6tIPV6_DYNAMIC_TYPESs'/etc/NetworkManager/NetworkManager.conftcentostfedoratrheltsuset#cCsfddg}xJtdt|D]3}||rK|d||||((s;/usr/lib/python2.7/site-packages/cloudinit/net/sysconfig.pyR?s( RKRLRMRR4RuR_tsetterRR,R=R\R?(((s;/usr/lib/python2.7/site-packages/cloudinit/net/sysconfig.pyRvs   tRenderercBs^eZdZedefdefd9d:gZed;d<d=d>d?d@dAdBdCdDdEdFdGdHdIgZedJdKdLgZiZ dMd+Z e d,Z e d-Ze d.Ze d/Ze d0Ze d1Ze d2ZedMd3ZedMd4Ze d5Ze d6Ze dMd7ZdMdMd8ZRS(Ns7Renders network information in a /etc/sysconfig format.tONBOOTtUSERCTLt BOOTPROTOtnonet STARTMODEtautot bond_modesmode=%stbond_xmit_hash_policysxmit_hash_policy=%st bond_miimons miimon=%stbond_min_linkss min_links=%stbond_arp_intervalsarp_interval=%stbond_arp_ip_targetsarp_ip_target=%stbond_arp_validatesarp_validate=%stbond_ad_selects ad_select=%stbond_num_grat_arpsnum_grat_arp=%stbond_downdelays downdelay=%st bond_updelays updelay=%stbond_lacp_rates lacp_rate=%stbond_fail_over_macsfail_over_mac=%st bond_primarys primary=%stbond_primary_reselectsprimary_reselect=%st bridge_stptSTPt bridge_ageingtAGEINGtbridge_bridgepriotPRIOcCs|si}n|jdd|_|jdd|_|jdd|_d}|jd||_i|jd d 6|jd d 6|jd d 6|_dS( Nt sysconf_dirs etc/sysconfigt netrules_paths(etc/udev/rules.d/70-persistent-net.rulestdns_pathsetc/resolv.confs,etc/NetworkManager/conf.d/99-cloud-init.conftnetworkmanager_conf_pathtcontrolRR(RRRRRR(R3R-t nm_conf_path((s;/usr/lib/python2.7/site-packages/cloudinit/net/sysconfig.pyR4?s   cCsx!|jD]\}}|||\}}d|}|||<||}||d s4   "  0YD