
    x[h              
           % S r SSKrSSKJrJr  SSKJr  SSKJr  SSK	J
r
  SSKJr  \R                  " \5      rSS	S
.rS/ SQ\S/S.r\
\S'   S rS\S\S\S\SS4
S jrg)z"Resolv Conf: configure resolv.conf    N)	templaterutil)Cloud)Config)
MetaSchema)PER_INSTANCEzresolv.confzsystemd.resolved.conf)z/etc/resolv.confz/etc/systemd/resolved.confcc_resolv_conf)alpine
azurelinuxfedoramarineropensusezopensuse-leapzopensuse-microoszopensuse-tumbleweedphotonrhelsle_hpcz	sle-microsles	openeulermanage_resolv_conf)iddistros	frequencyactivate_by_schema_keysmetac                    / n/ nSU;   a^  US   R                  5        HG  u  pV[        U[        5      (       d  M  U(       a  UR                  U5        M6  UR                  U5        MI     X4-    H	  nUS   U	 M     UR	                  S5      (       d  0 US'   X1S'   [
        R                  SU 5        [        R                  " XU5        g )Noptionsflagsz$Writing resolv.conf from template %s)	items
isinstanceboolappendgetLOGdebugr   render_to_file)template_fnparamstarget_fnamer   false_flagskeyvalflags           A/usr/lib/python3/dist-packages/cloudinit/config/cc_resolv_conf.pygenerate_resolv_confr-   1   s    EKFy)//1HC#t$$LL%&&s+ 2 #9d# $ ::i  y7OII4kB[?    namecfgcloudargsreturnc                    SU;  a  [         R                  SU 5        g[        R                  " USS5      (       d  [         R                  SU 5        gSU;  a  [         R	                  S5        g UR                  [        UR                  R                     5      n[        UUS   UR                  R                  S	9  g! [         a    [         R	                  S5         gf = f)
a?  
Handler for resolv.conf

@param name: The module name "resolv_conf" from cloud.cfg
@param cfg: A nested dict containing the entire cloud config contents.
@param cloud: The L{CloudInit} object in use.
@param log: Pre-initialized Python logger object to use for logging.
@param args: Any module arguments from cloud.cfg
r   zFSkipping module named %s, no 'manage_resolv_conf' key in configurationNFzGSkipping module named %s, 'manage_resolv_conf' present but set to Falseresolv_confz3manage_resolv_conf True but no parameters provided!z0No template found, not rendering resolve configs)r%   r&   r'   )r"   r#   r   get_cfg_option_boolwarningget_template_filenameRESOLVE_CONFIG_TEMPLATE_MAPdistroresolve_conf_fnKeyErrorr-   )r/   r0   r1   r2   r%   s        r,   handler=   H   s     3&		<	

 	##C)=uEE		=	

 	CIJ11'(D(DE
 =!\\11
   FGs   /,B> >C C )__doc__logging	cloudinitr   r   cloudinit.cloudr   cloudinit.configr   cloudinit.config.schemar   cloudinit.settingsr   	getLogger__name__r"   r9   r   __annotations__r-   strlistr=    r.   r,   <module>rK      s    )  % ! # . +! &"9     45'j .@.+ +6 +% +t + +r.   