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_landscape.cpython-311.pyc
�

܍~cp��6�UdZddlZddlmZddlmZddlmZddlm	Z	ddl
mZmZm
Z
ddlmZdd	lmZdd
lmZmZddlmZdZd
Zdddddd�iZdZdgZdddeeed��ed��gedgd�Zeed<ee��Zdeded ed!ed"ed#dfd$�Z d%�Z!dS)&z&install and configure landscape client�N)�BytesIO)�Logger)�dedent)�	ConfigObj)�subp�
type_utils�util)�Cloud)�Config)�
MetaSchema�get_meta_doc)�PER_INSTANCEz/etc/landscape/client.confz/etc/default/landscape-client�client�infoz.https://landscape.canonical.com/message-systemz#http://landscape.canonical.com/pingz/var/lib/landscape/client)�	log_level�url�ping_url�	data_patha�This module installs and configures ``landscape-client``. The landscape client
will only be installed if the key ``landscape`` is present in config. Landscape
client configuration is given under the ``client`` key under the main
``landscape`` config key. The config parameters are not interpreted by
cloud-init, but rather are converted into a ConfigObj formatted file and
written out to the `[client]` section in ``/etc/landscape/client.conf``.

The following default client config is provided, but can be overridden::

    landscape:
        client:
            log_level: "info"
            url: "https://landscape.canonical.com/message-system"
            ping_url: "http://landscape.canoncial.com/ping"
            data_path: "/var/lib/landscape/client"

.. note::
    see landscape documentation for client config keys

.. note::
    if ``tags`` is defined, its contents should be a string delimited with
    ``,`` rather than a list
�ubuntu�cc_landscape�	Landscapez&Install and configure landscape clienta�            # To discover additional supported client keys, run
            # man landscape-config.
            landscape:
                client:
                    url: "https://landscape.canonical.com/message-system"
                    ping_url: "http://landscape.canonical.com/ping"
                    data_path: "/var/lib/landscape/client"
                    http_proxy: "http://my.proxy.com/foobar"
                    https_proxy: "https://my.proxy.com/foobar"
                    tags: "server,cloud"
                    computer_title: "footitle"
                    registration_key: "fookey"
                    account_name: "fooaccount"
            z�            # Any keys below `client` are optional and the default values will
            # be used.
            landscape:
                client: {}
            �	landscape)�id�name�title�description�distros�examples�	frequency�activate_by_schema_keys�metar�cfg�cloud�log�args�returnc���|�di��}t|t��s5td�tj|��������|sdS|j�d��tt|g}t|��}t��}|�
|��tjt j�t����tjt|�����|�dt��tjt,d��t/jgd���dS)	z�
    Basically turn a top level 'landscape' entry with a 'client' dict
    and render it to ConfigObj format under '[client]' section in
    /etc/landscape/client.conf
    rzR'landscape' key existed in config, but not a dictionary type, is a {_type} instead)�_typeN)�landscape-clientz!Wrote landscape config file to %szRUN=1
)�servicer)�restart)�get�
isinstance�dict�RuntimeError�formatr�obj_name�distro�install_packages�LSC_BUILTIN_CFG�LSC_CLIENT_CFG_FILE�merge_togetherr�writer	�
ensure_dir�os�path�dirname�
write_file�getvalue�debug�LS_DEFAULT_FILEr)	rr"r#r$r%�ls_cloudcfg�
merge_data�merged�contentss	         �?/usr/lib/python3/dist-packages/cloudinit/config/cc_landscape.py�handlerEgsG���'�'�+�r�*�*�K��k�D�*�*�
��
$�$*�F� �)�+�6�6�%+�%�%�
�
�	
�����	�L�!�!�"7�8�8�8�	����J�
�J�
'�
'�F��y�y�H�
�L�L������O�B�G�O�O�$7�8�8�9�9�9��O�'��):�):�)<�)<�=�=�=��I�I�1�3F�G�G�G��O�O�Y�/�/�/��I�8�8�8�9�9�9�9�9�c���ti��}|D]R}|s�t|t��r|�|���0|�t|�����S|S)zu
    merge together ConfigObj objects or things that ConfigObj() will take in
    later entries override earlier
    )rr-�merge)�objsr"�objs   rDr6r6�sl��
�B�-�-�C��&�&���	���c�9�%�%�	&��I�I�c�N�N�N�N��I�I�i��n�n�%�%�%�%��JrF)"�__doc__r9�ior�loggingr�textwrapr�	configobjr�	cloudinitrrr	�cloudinit.cloudr
�cloudinit.configr�cloudinit.config.schemarr
�cloudinit.settingsrr5r?r4�MODULE_DESCRIPTIONrr!�__annotations__�str�listrEr6�rFrD�<module>rZs���-�,�,�	�	�	�	�������������������������,�,�,�,�,�,�,�,�,�,�!�!�!�!�!�!�#�#�#�#�#�#�<�<�<�<�<�<�<�<�+�+�+�+�+�+�2��1��
��?�9�0�	������0�*����
5�%����
�	
�	
�"	��
�	
�	
�%�6� +�}�E#�#��j�#�#�#�J�,�t�
�
��&:�

�&:��&:�#(�&:�/5�&:�=A�&:�	�&:�&:�&:�&:�R
�
�
�
�
rF