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

܍~c���V�UdZddlmZddlmZddlmZddlmZmZm	Z	ddl
mZddlm
Z
ddlmZmZdd	lmZeje��Zd
ZdZeZdgZd
dded��eed��ed��ed��gedgd�Zeed<ee��Zdede
dedededdfd�Zd�ZdS) z0Apk Configure: Configures apk repositories file.�)�Logger)�dedent)�log)�
temp_utils�	templater�util)�Cloud)�Config)�
MetaSchema�get_meta_doc)�PER_INSTANCEz+https://alpine.global.ssl.fastly.net/alpinea## template:jinja
#
# Created by cloud-init
#
# This file is written on first boot of an instance
#

{{ alpine_baseurl }}/{{ alpine_version }}/main
{% if community_enabled -%}
{{ alpine_baseurl }}/{{ alpine_version }}/community
{% endif -%}
{% if testing_enabled -%}
{% if alpine_version != 'edge' %}
#
# Testing - using with non-Edge installation may cause problems!
#
{% endif %}
{{ alpine_baseurl }}/edge/testing
{% endif %}
{% if local_repo != '' %}

#
# Local repo
#
{{ local_repo }}/{{ alpine_version }}
{% endif %}

�alpine�cc_apk_configurez
APK ConfigurezConfigure apk repositories filez�        This module handles configuration of the /etc/apk/repositories file.

        .. note::
          To ensure that apk configuration is valid yaml, any strings
          containing special characters, especially ``:`` should be quoted.
    z�        # Keep the existing /etc/apk/repositories file unaltered.
        apk_repos:
            preserve_repositories: true
        z�        # Create repositories file for Alpine v3.12 main and community
        # using default mirror site.
        apk_repos:
            alpine_repo:
                community_enabled: true
                version: 'v3.12'
        a�        # Create repositories file for Alpine Edge main, community, and
        # testing using a specified mirror site and also a local repo.
        apk_repos:
            alpine_repo:
                base_url: 'https://some-alpine-mirror/alpine'
                community_enabled: true
                testing_enabled: true
                version: 'edge'
            local_repo_base_url: 'https://my-local-server/local-alpine'
        �	apk_repos)�id�name�title�description�distros�examples�	frequency�activate_by_schema_keys�metar�cfg�cloudr�args�returnNc���|�d��}|st�d|��dStj|dd��rt�d|��dS|�d��}|st�d|��dS|�d	��}|st�d
|��dS|�dd��}t|||��dS)
a{
    Call to handle apk_repos sections in cloud-config file.

    @param name: The module name "apk-configure" from cloud.cfg
    @param cfg: A nested dict containing the entire cloud config contents.
    @param cloud: The CloudInit object in use.
    @param log: Pre-initialized Python logger object to use for logging.
    @param _args: Any module arguments from cloud.cfg
    rz6Skipping module named %s, no 'apk_repos' section foundN�preserve_repositoriesFz8Skipping module named %s, 'preserve_repositories' is set�alpine_repoz>Skipping module named %s, no 'alpine_repo' configuration found�versionz@Skipping module named %s, 'version' not specified in alpine_repo�local_repo_base_url�)�get�LOG�debugr�get_cfg_option_bool�_write_repositories_file)	rrrrr�apk_sectionr �alpine_version�
local_repos	         �C/usr/lib/python3/dist-packages/cloudinit/config/cc_apk_configure.py�handler-ps#���'�'�+�&�&�K����	�	�D�d�	
�	
�	
�	�����-D�e�L�L���	�	�F��	
�	
�	
�	��
�/�/�-�0�0�K����	�	�L��	
�	
�	
�	��!�_�_�Y�/�/�N����	�	�N��	
�	
�	
�	�����!6��;�;�J��[�.�*�E�E�E�E�E�c��d}|�dt��}|||�d��|�d��|d�}tjdd���}|d	}t	j|t�
��t�d|��tj
|||��t	j|��dS)
a
    Write the /etc/apk/repositories file with the specified entries.

    @param alpine_repo: A nested dict of the alpine_repo configuration.
    @param alpine_version: A string of the Alpine version to use.
    @param local_repo: A string containing the base URL of a local repo.
    z/etc/apk/repositories�base_url�community_enabled�testing_enabled)�alpine_baseurlr*r1r2r+ztemplate_name-z.tmpl)�prefix�suffix�)�contentz3Generating Alpine repository configuration file: %sN)r$�DEFAULT_MIRRORr�mkstempr�
write_file�REPOSITORIES_TEMPLATEr%r&r�render_to_file�del_file)r r*r+�	repo_filer3�params�tfile�template_fns        r,r(r(�s���(�I� �_�_�Z��@�@�N�)�(�(�_�_�-@�A�A�&�?�?�+<�=�=� ���F�
��&6�w�G�G�G�E���(�K��O�K�)>�?�?�?�?��I�I�C�Y�O�O�O�
��[�)�V�<�<�<��M�+�����r.) �__doc__�loggingr�textwrapr�	cloudinitrrrr�cloudinit.cloudr	�cloudinit.configr
�cloudinit.config.schemarr�cloudinit.settingsr
�	getLogger�__name__r%r8r;rrr�__annotations__�str�listr-r(�r.r,�<module>rPs���7�6�6�������������$�$�$�$�$�$�1�1�1�1�1�1�1�1�1�1�!�!�!�!�!�!�#�#�#�#�#�#�<�<�<�<�<�<�<�<�+�+�+�+�+�+��g���!�!��?����>
�	��*��
��
.��6�	������
�	
�	
�	��
�		
�		
�	��

�	
�	
�%�@� +�}�_0�0��j�0�0�0�d�,�t�
�
��4F�

�4F��4F�#(�4F�/5�4F�=A�4F�	�4F�4F�4F�4F�n����r.