HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /lib/python3/dist-packages/cloudinit/config/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/cloudinit/config/__pycache__/cc_update_hostname.cpython-311.pyc
�

܍~c���0�UdZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
mZdd	lmZd
ZdgZdd
deeed��ed��ed��ed��ed��gegd�Ze
ed<ee��Zdedede	dededdfd�ZdS)z)Update Hostname: Update hostname and fqdn�N)�Logger)�dedent)�util)�Cloud)�Config)�
MetaSchema�get_meta_doc)�
PER_ALWAYSz�This module will update the system hostname and fqdn. If ``preserve_hostname``
is set ``true``, then the hostname will not be altered.

.. note::
    for instructions on specifying hostname and fqdn, see documentation for
    ``cc_set_hostname``
�all�cc_update_hostnamezUpdate HostnamezUpdate hostname and fqdna�        # By default: when ``preserve_hostname`` is not specified cloud-init
        # updates ``/etc/hostname`` per-boot based on the cloud provided
        # ``local-hostname`` setting. If you manually change ``/etc/hostname``
        # after boot cloud-init will no longer modify it.
        #
        # This default cloud-init behavior is equivalent to this cloud-config:
        preserve_hostname: false
        zh        # Prevent cloud-init from updating the system hostname.
        preserve_hostname: true
        ze        # Prevent cloud-init from updating ``/etc/hostname``
        preserve_hostname: true
        z�        # Set hostname to "external.fqdn.me" instead of "myhost"
        fqdn: external.fqdn.me
        hostname: myhost
        prefer_fqdn_over_hostname: true
        z�        # Set hostname to "external" instead of "external.fqdn.me" when
        # cloud metadata provides the ``local-hostname``: "external.fqdn.me".
        prefer_fqdn_over_hostname: false
        )�id�name�title�description�distros�examples�	frequency�activate_by_schema_keys�metar�cfg�cloud�log�args�returnc�R�tj|dd��r|�d|��dStj|dd��}|�|j�d|��tj||��\}}}|r|dkr|�d��dS	tj�|�	d��d��}	|�d	||��|j�
|||	��dS#t$rtj|d
||���wxYw)N�preserve_hostnameFzWConfiguration option 'preserve_hostname' is set, not updating the hostname in module %s�prefer_fqdn_over_hostname�	localhostz6Hostname is localhost. Let other services handle this.�datazprevious-hostnamezUpdating hostname to %s (%s)z(Failed to update the hostname to %s (%s))
r�get_cfg_option_bool�debug�distro�
set_option�get_hostname_fqdn�os�path�join�	get_cpath�update_hostname�	Exception�logexc)
rrrrr�
hostname_fqdn�hostname�fqdn�
is_default�prev_fns
          �E/usr/lib/python3/dist-packages/cloudinit/config/cc_update_hostname.py�handler2Us]�����%8�%�@�@���	�	�
6��	
�	
�	
�
	���,��
(�$���M�� �
���� ;�]�K�K�K�#'�#9�#�u�#E�#E� �X�t�Z���h�+�-�-��	�	�J�K�K�K�����'�,�,�u���v�6�6�8K�L�L���	�	�0�$��A�A�A�
��$�$�X�t�W�=�=�=�=�=���������;�T�8�	
�	
�	
�	�	���s
�A&D�#D&)�__doc__r%�loggingr�textwrapr�	cloudinitr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemarr	�cloudinit.settingsr
�MODULE_DESCRIPTIONrr�__annotations__�str�listr2��r1�<module>rAs���0�/�/�	�	�	�	�������������������!�!�!�!�!�!�#�#�#�#�#�#�<�<�<�<�<�<�<�<�)�)�)�)�)�)����'����
'�%����
�
	
�
	
�	��
�	
�	
�	��
�	
�	
�	��
�	
�	
�	��
�	
�	
�A'�P�!�_0�0��j�0�0�0�d�,�t�
�
�� �

� �� �#(� �/5� �=A� �	� � � � � � r@