HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/cloudinit/config/__pycache__/cc_update_hostname.cpython-38.pyc
U

Ӈg��@s�UdZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZdd	gegd
�Z
e
ed<e�e�Zeeeedd�d
d�ZdS)z)Update Hostname: Update hostname and fqdn�N)�util)�Cloud)�Config)�
MetaSchema)�
PER_ALWAYSZcc_update_hostname�all)�idZdistrosZ	frequencyZactivate_by_schema_keys�meta)�name�cfg�cloud�args�returnc
	Cs�t�|dd�rt�d|�dSt�|dd�}|dk	rB|j�d|�t�|dd�}|dk	rf|j�d|�t�||�\}}}|r�|dkr�t�d�dSz6tj�	|�
d�d	�}	t�d
||�|j�|||	�Wn&tk
r�t�
td||��YnXdS)NZpreserve_hostnameFzWConfiguration option 'preserve_hostname' is set, not updating the hostname in module %sZprefer_fqdn_over_hostname�create_hostname_fileZ	localhostz6Hostname is localhost. Let other services handle this.�datazprevious-hostnamezUpdating hostname to %s (%s)z(Failed to update the hostname to %s (%s))rZget_cfg_option_bool�LOG�debugZdistroZ
set_optionZget_hostname_fqdn�os�path�joinZ	get_cpathZupdate_hostname�	ExceptionZlogexc)
r
rrr
Z
hostname_fqdnrZhostnameZfqdnZ
is_defaultZprev_fn�r�E/usr/lib/python3/dist-packages/cloudinit/config/cc_update_hostname.py�handlesH���
�r)�__doc__ZloggingrZ	cloudinitrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarZcloudinit.settingsrr	�__annotations__Z	getLogger�__name__r�str�listrrrrr�<module>	s�