
    x[h              
           % S r SSKrSSKrSSKJr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SS	/\/ S
.r\
\S'   \R                  " \5      rS\S\S\S\SS4
S jrg)z)Update Hostname: Update hostname and fqdn    N)util)Cloud)Config)
MetaSchema)
PER_ALWAYScc_update_hostnameall)iddistros	frequencyactivate_by_schema_keysmetanamecfgcloudargsreturnc                    [         R                  " USS5      (       a  [        R                  SU 5        g [         R                  " USS 5      nUb  UR                  R                  SU5        [         R                  " USS 5      nUb  UR                  R                  SU5        [         R                  " X5      u  pgnU(       a  US:X  a  [        R                  S5        g  [        R                  R                  UR                  S5      S	5      n	[        R                  S
Xv5        UR                  R                  XgU	5        g ! [         a    [         R                  " [        SXv5        e f = f)Npreserve_hostnameFzWConfiguration option 'preserve_hostname' is set, not updating the hostname in module %sprefer_fqdn_over_hostnamecreate_hostname_file	localhostz6Hostname is localhost. Let other services handle this.datazprevious-hostnamezUpdating hostname to %s (%s)z(Failed to update the hostname to %s (%s))r   get_cfg_option_boolLOGdebugdistro
set_optionget_hostname_fqdnospathjoin	get_cpathupdate_hostname	Exceptionlogexc)
r   r   r   r   hostname_fqdnr   hostnamefqdn
is_defaultprev_fns
             E/usr/lib/python3/dist-packages/cloudinit/config/cc_update_hostname.pyhandler-      s>   %8%@@		6	

 	 ,,($M   ;]K  33#T ' 68LM#'#9#9##E XZh+-		JK'',,uv68KL		0$A$$XW= ;T	
 		s    A!E (E*)__doc__loggingr    	cloudinitr   cloudinit.cloudr   cloudinit.configr   cloudinit.config.schemar   cloudinit.settingsr   r   __annotations__	getLogger__name__r   strlistr-        r,   <module>r<      sw    0  	  ! # . ) w!	j  !% %6 %% %t % %r;   