a ah€i± ã@s UdZddlZddlmZmZddlmZddlmZddl m Z ddl m Z e  e¡Zdd d œZd gd ¢e d gdœZe ed<dd„Zeeeeddœdd„ZdS)z"Resolv Conf: configure resolv.conféN)Ú templaterÚutil)ÚCloud)ÚConfig)Ú MetaSchema)Ú PER_INSTANCEz resolv.confzsystemd.resolved.conf)z/etc/resolv.confz/etc/systemd/resolved.confZcc_resolv_conf)Z almalinuxZ cloudlinuxZalpineZ azurelinuxZfedoraZmarinerZopensusez opensuse-leapzopensuse-microoszopensuse-tumbleweedZphotonZrhelZsle_hpcz sle-microZslesZ openeulerÚmanage_resolv_conf)ÚidZdistrosZ frequencyZactivate_by_schema_keysÚmetacCsšg}g}d|vrJ|d ¡D],\}}t|tƒr|r>| |¡q| |¡q||D]}|d|=qR| d¡sti|d<||d<t d|¡t |||¡dS)NÚoptionsÚflagsz$Writing resolv.conf from template %s) ÚitemsÚ isinstanceÚboolÚappendÚgetÚLOGÚdebugrZrender_to_file)Ú template_fnÚparamsÚ target_fnamer Z false_flagsÚkeyÚvalÚflag©rúC/usr/lib/python3.9/site-packages/cloudinit/config/cc_resolv_conf.pyÚgenerate_resolv_conf3s       r)ÚnameÚcfgÚcloudÚargsÚreturncCsœd|vrt d|¡dSt |dd¡s6t d|¡dSd|vrLt d¡dSz| t|jj¡}Wnt y€t d¡YdS0t ||d|jjd dS) 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 rzFSkipping module named %s, no 'manage_resolv_conf' key in configurationNFzGSkipping module named %s, 'manage_resolv_conf' present but set to FalseZ resolv_confz3manage_resolv_conf True but no parameters provided!z0No template found, not rendering resolve configs)rrr) rrrZget_cfg_option_boolZwarningZget_template_filenameÚRESOLVE_CONFIG_TEMPLATE_MAPZdistroZresolve_conf_fnÚKeyErrorr)rrrr rrrrÚhandleJs8 ýý  ÿ  ýr$)Ú__doc__ZloggingZ cloudinitrrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarZcloudinit.settingsrZ getLoggerÚ__name__rr"r Ú__annotations__rÚstrÚlistr$rrrrÚ s"     þë