AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/cloudinit/config/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/cloudinit/config/__pycache__/cc_set_hostname.cpython-310.pyc
o

x[h�
�
@s�UdZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZd
egegd�Zeed<e�e�ZGd
d�de�Zdede
dededdf
dd�ZdS)z#Set Hostname: Set hostname and FQDN�N)�util)�
write_json)�Cloud)�Config)�
MetaSchema)�ALL_DISTROS)�PER_INSTANCE�cc_set_hostname)�id�distros�	frequency�activate_by_schema_keys�metac@seZdZdZdS)�SetHostnameErrorz�Raised when the distro runs into an exception when setting hostname.

    This may happen if we attempt to set the hostname early in cloud-init's
    init-local timeframe as certain services may not be running yet.
    N)�__name__�
__module__�__qualname__�__doc__�rr�B/usr/lib/python3/dist-packages/cloudinit/config/cc_set_hostname.pyrsr�name�cfg�cloud�args�returnc
Cs|t�|dd�rt�d|�dSt�|dd�}|dur!|j�d|�t�|dd�}|dur3|j�d|�t�||�\}}}tj�	|�
d�d�}	i}
tj�|	�r^t�|	�j
dkr^t�t�|	��}
||
�d	�kpk||
�d
�k}|sut�d�dS|r�|dkr�t�d
�dSt�d||�z	|j�||�Wn!ty�}zd||f}
t�t|
�td|
|f�|�d}~wwt|	||d��dS)N�preserve_hostnameFzVConfiguration option 'preserve_hostname' is set, not setting the hostname in module %s�prefer_fqdn_over_hostname�create_hostname_file�datazset-hostnamer�hostname�fqdnz*No hostname changes. Skipping set_hostname�	localhostz6Hostname is localhost. Let other services handle this.zSetting the hostname to %s (%s)z%Failed to set the hostname to %s (%s)z%s: %s)rr )r�get_cfg_option_bool�LOG�debug�distro�
set_option�get_hostname_fqdn�os�path�join�	get_cpath�exists�stat�st_size�	load_json�load_text_file�get�set_hostname�	Exception�logexcrr)rrrr�
hostname_fqdnrrr �
is_default�prev_fn�
prev_hostname�hostname_changed�e�msgrrr�handle'sT�����

��r<)r�loggingr(�	cloudinitr�cloudinit.atomic_helperr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemar�cloudinit.distrosr�cloudinit.settingsrr�__annotations__�	getLoggerrr#r3r�str�listr<rrrr�<module>s$�
"

Anon7 - 2022
AnonSec Team