�
oB�]c@sEdZddlZddlmZddlmZeZd�ZdS(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(tutilcCs�tj|dt�r)|jd|�dStj||�\}}yKtjj|jd�d�}|jd||�|j j
|||�Wn*tk
r�tj|d||��nXdS(Ntpreserve_hostnamesWConfiguration option 'preserve_hostname' is set, not updating the hostname in module %stdatasprevious-hostnamesUpdating hostname to %s (%s)s(Failed to update the hostname to %s (%s)(
Rtget_cfg_option_booltFalsetdebugtget_hostname_fqdntostpathtjoint get_cpathtdistrotupdate_hostnamet Exceptiontlogexc(tnametcfgtcloudtlogt_argsthostnametfqdntprev_fn((sG/usr/lib/python2.7/site-packages/cloudinit/config/cc_update_hostname.pythandle*s
(t__doc__Rtcloudinit.settingsRt cloudinitRt frequencyR(((sG/usr/lib/python2.7/site-packages/cloudinit/config/cc_update_hostname.pyt<module> s
|