Current File : //lib/python2.7/site-packages/cloudinit/config/cc_fan.pyc |
�
oB�]c @ sx d Z d d l m Z d d l m Z d d l m Z e j e � Z e Z
i d
d 6d d 6Z e
d � Z d � Z d
S( s<
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
i����( t log( t PER_INSTANCE( t utilt configs /etc/network/fant config_pathc s! | r? i d d � g d 6d d � g d 6d d � g d 6} n i d d g d 6d d g d 6} � f d � } | | d d d � �} | j d � s� | d 7} n t j | | d
d �| | d d d � �} | r� | r� t j d
� � n d | k r| | d d d � �} n | S( Nt systemctlt stopt startt enablet servicec sK y t j | d t �SWn- t j k
rF } t j d � | | � t SXd S( Nt captures failed: %s (%s): %s( R t subpt Truet ProcessExecutionErrort LOGt warningt False( t cmdt msgt e( R ( s; /usr/lib/python2.7/site-packages/cloudinit/config/cc_fan.pyt run? s
R s stop %ss
t omodet ws start %ss success: %s starteds enable %s( t endswithR t
write_fileR R ( R t config_filet contentt systemdt cmdsR t stop_failedt ret( ( R s; /usr/lib/python2.7/site-packages/cloudinit/config/cc_fan.pyt stop_update_start6 s"