name : cc_fan.cpython-39.pyc
a

'�Dg��@s�UdZddlZddlmZmZddlmZddlmZddl	m
Z
ddlmZdd	ged
gd�Z
e
ed<e�e�Zdd
d�Zdd�Zeeeedd�dd�ZdS)z$Fan: Configure ubuntu fan networking�N)�subp�util)�Cloud)�Config)�
MetaSchema)�PER_INSTANCEZcc_fanZubuntu�fan)�idZdistrosZ	frequencyZactivate_by_schema_keys�metaz/etc/network/fan)�config�config_pathc
Cs�z|�d|�d}Wn8tjyL}zd}t�d||�WYd}~n
d}~00|�d�s`|d7}tj||dd�z |�d|�|r�t�d	|�Wn4tjy�}zt�d
||�WYd}~n
d}~00|�d|�dS)N�stopFTzfailed to stop %s: %s�
�w�Zomode�startzsuccess: %s startedzfailed to start %s: %s�enable)Zmanage_servicerZProcessExecutionError�LOGZwarning�endswithr�
write_file)�distro�service�config_file�contentZstop_failed�e�r�;/usr/lib/python3.9/site-packages/cloudinit/config/cc_fan.py�stop_update_starts $
$r)�name�cfg�cloud�args�returncCs�|�d�}|si}t�|tg�}|�d�s:t�d|�dStj|�d�|�d�dd�|j}t�	d�sr|�
dg�t|d|�d�|�d�d	�dS)
Nrrz$%s: no 'fan' config entry. disablingrrrZfanctlz
ubuntu-fan)rrr)�getrZ
mergemanydict�BUILTIN_CFGr�debugrrr�whichZinstall_packagesr)rrr r!ZcfginZmycfgrrrr�handle5s"


�r')�__doc__ZloggingZ	cloudinitrrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarZcloudinit.settingsrr
�__annotations__Z	getLogger�__name__rr$r�str�listr'rrrr�<module>s"�
�

© 2025 Cubjrnet7