| Server IP : 23.254.227.96 / Your IP : 216.73.216.183 Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64 User : viralblo ( 1001) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.6/site-packages/cloudinit/config/__pycache__/ |
Upload File : |
3
��b
� @ sX d Z ddlmZ ddlmZmZ ddlmZ eje �Z
eZddd�Zdd � Z
d
d� ZdS )a<
Fan
---
**Summary:** configure ubuntu fan networking
This 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)
**Internal name:** ``cc_fan``
**Module frequency:** per instance
**Supported distros:** ubuntu
**Config keys**::
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
� )�log)�subp�util)�PER_INSTANCENz/etc/network/fan)�config�config_pathc C s� y| j d|� d}W n6 tjk
rJ } zd}tjd||� W Y d d }~X nX |jd�s^|d7 }tj||dd� y | j d|� |r�tjd |� W n2 tjk
r� } ztjd
||� W Y d d }~X nX | j d|� d S )N�stopFTzfailed to stop %s: %s�
�w)�omode�startzsuccess: %s startedzfailed to start %s: %s�enable)Zmanage_servicer ZProcessExecutionError�LOGZwarning�endswithr �
write_file)�distro�service�config_file�contentZstop_failed�e� r �/usr/lib/python3.6/cc_fan.py�stop_update_start6 s
r c C s� |j d�}|si }tj|tg�}|j d�s:tjd| � d S tj|j d�|j d�dd� |j}tj d�sr|j
dg� t|d|j d�|j d�d � d S )
NZfanr z$%s: no 'fan' config entry. disablingr r
)r Zfanctlz
ubuntu-fan)r r r )�getr Z
mergemanydict�BUILTIN_CFGr �debugr r r ZwhichZinstall_packagesr )�nameZcfgZcloudr �argsZcfginZmycfgr r r r �handleL s
r )�__doc__Z cloudinitr Zloggingr r Zcloudinit.settingsr Z getLogger�__name__r Z frequencyr r r r r r r �<module>&