Current File : //lib/python2.7/site-packages/cloudinit/config/cc_update_hostname.pyo |
�
oB�]c @ sE d Z d d l Z d d l m Z d d l m Z e Z d � Z d S( s
Update Hostname
---------------
**Summary:** update hostname and fqdn
This module will update the system hostname and fqdn. If ``preserve_hostname``
is set, then the hostname will not be altered.
.. note::
for instructions on specifying hostname and fqdn, see documentation for
``cc_set_hostname``
**Internal name:** ``cc_update_hostname``
**Module frequency:** per always
**Supported distros:** all
**Config keys**::
preserve_hostname: <true/false>
fqdn: <fqdn>
hostname: <fqdn/hostname>
i����N( t
PER_ALWAYS( t utilc C s� t j | d t � r) | j d | � d St j | | � \ } } yK t j j | j d � d � } | j d | | � | j j
| | | � Wn* t k
r� t j | d | | � � n Xd S( Nt preserve_hostnamesW Configuration option 'preserve_hostname' is set, not updating the hostname in module %st datas previous-hostnames Updating hostname to %s (%s)s( Failed to update the hostname to %s (%s)(
R t get_cfg_option_boolt Falset debugt get_hostname_fqdnt ost patht joint get_cpatht distrot update_hostnamet Exceptiont logexc( t namet cfgt cloudt logt _argst hostnamet fqdnt prev_fn( ( sG /usr/lib/python2.7/site-packages/cloudinit/config/cc_update_hostname.pyt handle* s
( t __doc__R t cloudinit.settingsR t cloudinitR t frequencyR ( ( ( sG /usr/lib/python2.7/site-packages/cloudinit/config/cc_update_hostname.pyt <module> s