%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/cloudinit/config/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/cloudinit/config/__pycache__/cc_set_hostname.cpython-312.pyc

�

���f�
�
���UdZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZd
egegd�Zeed<ej&e�ZGd
�de�Zdede
dededdf
d�Zy)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��eZdZdZy)�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__���B/usr/lib/python3/dist-packages/cloudinit/config/cc_set_hostname.pyrrs��rr�name�cfg�cloud�args�returnc�j�tj|dd�rtjd|�ytj|dd�}|�|jjd|�tj|dd�}|�|jjd|�tj||�\}}}tjj|jd�d�}	i}
tjj|	�rJtj|	�jdkDr(tjtj|	��}
||
j!d	�k7xs||
j!d
�k7}|stjd�y|r|dk(rtjd
�ytjd||�	|jj#||�t+|	||d��y#t$$r9}d|�d|�d�}
tj&t|
�t)|
�d|���|�d}~wwxYw)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)zFailed to set the hostname to z (�)z: )r#r$)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_fqdnr!r#r$�
is_default�prev_fn�
prev_hostname�hostname_changed�e�msgs              r�handlerA's�������%8�%�@��	�	�
5��	
�
	��,�,��
(�$��M�� �
����� ;�]�K� �3�3��
#�T����'�
����� 6�8L�M�#'�#9�#9�#�u�#E� �X�t�Z��g�g�l�l�5�?�?�6�2�N�C�G��M�	�w�w�~�~�g��2�7�7�7�#3�#;�#;�a�#?����t�':�':�7�'C�D�
��=�#4�#4��$��+�	
��"�"�6�*�	*����	�	�>�?���h�+�-��	�	�J�K���I�I�/��x�@�;�
���!�!�(�D�1�
�w�X�t�<�=��	�;�9=�x�H�����C����3��2�3��:��;�s�G0�0	H2�94H-�-H2)r�loggingr-�	cloudinitr�cloudinit.atomic_helperr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemar�cloudinit.distrosr�cloudinit.settingsr	r�__annotations__�	getLoggerrr(r8r�str�listrArrr�<module>rNs���*��	��.�!�#�.�)�+���}��!�	��j���g����!���y��4>��4>�6�4>�%�4>�t�4>��4>r

Zerion Mini Shell 1.0