Current Dir: /snap/core22/2437/usr/lib/python3/dist-packages/cloudinit/config/__pycache__/

[FILE] cc_ansible.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_apk_configure.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_apt_configure.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_apt_pipelining.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_bootcmd.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_byobu.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ca_certs.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_chef.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_disable_ec2_metadata.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_disk_setup.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_fan.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_final_message.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_growpart.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_grub_dpkg.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_install_hotplug.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_keyboard.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_keys_to_console.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_landscape.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_locale.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_lxd.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_mcollective.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_mounts.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ntp.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_package_update_upgrade_install.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_phone_home.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_power_state_change.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_puppet.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_raspberry_pi.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_reset_rmc.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_resizefs.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_resolv_conf.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_rh_subscription.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_rsyslog.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_runcmd.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_salt_minion.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_scripts_per_boot.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_scripts_per_instance.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_scripts_per_once.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_scripts_user.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_scripts_vendor.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_seed_random.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_set_hostname.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_set_passwords.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_snap.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_spacewalk.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ssh.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ssh_authkey_fingerprints.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ssh_import_id.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_timezone.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ubuntu_autoinstall.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ubuntu_drivers.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_ubuntu_pro.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_update_etc_hosts.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_update_hostname.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_users_groups.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_wireguard.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_write_files.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_write_files_deferred.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_yum_add_repo.cpython-310.pyc [ edit | delete | rename ]
[FILE] cc_zypper_add_repo.cpython-310.pyc [ edit | delete | rename ]
[FILE] modules.cpython-310.pyc [ edit | delete | rename ]
[FILE] schema.cpython-310.pyc [ edit | delete | rename ]
[FILE] __init__.cpython-310.pyc [ edit | delete | rename ]

Viewing: /snap/core22/2437/usr/lib/python3/dist-packages/cloudinit/config/__pycache__/cc_yum_add_repo.cpython-310.pyc

o

�t�h!�
@s�UdZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZd	gd
�edgd�Ze
ed
<e�e�Zdedefdd�Zdd�Zdd�Zdedede	deddf
dd�ZdS)z<Yum Add Repo: Add yum repository configuration to the system�N)�ConfigParser)�util)�Cloud)�Config)�
MetaSchema)�PER_INSTANCE�cc_yum_add_repo)�	almalinux�
azurelinux�centos�
cloudlinux�	eurolinux�fedora�mariner�	openeuler�OpenCloudOS�openmandriva�photon�rhel�rocky�	TencentOS�	virtuozzo�	yum_repos)�id�distros�	frequency�activate_by_schema_keys�meta�repo_id�returncCs|�dd�S)afCanonicalize repo id.

    The sole name convention for repo ids is to not contain namespaces,
    and typically the separator used is `-`. More info:
    https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sec-setting_repository_options

    :param repo_id: Repo id to convert.
    :return: Canonical repo id.
    � �-)�replace)r�r#�B/usr/lib/python3/dist-packages/cloudinit/config/cc_yum_add_repo.py�_canonicalize_id/s
r%cCsNt|t�rtt|��St|ttf�rd�dd�|D��St|t�s%t|�S|S)N�
cSsg|]}t|��qSr#)�_format_repo_value)�.0�vr#r#r$�
<listcomp>Csz&_format_repo_value.<locals>.<listcomp>)�
isinstance�bool�str�int�list�tuple�join)�valr#r#r$r'<s

r'cCsvt�}|�|�|��D]
\}}|�||t|��qt��}|�|�|�d�|�	�}|�
ddt���d�
|�S)Nrz# Created by cloud-init on %s
�)r�add_section�items�setr'�io�StringIO�write�seek�	readlines�insertr�time_rfc2822r1)r�repo_config�to_be�kr)�to_be_stream�linesr#r#r$�_format_repository_configKs



rC�name�cfg�cloud�argscCs`|�d�}|st�d|�dSt�|dd�}i}i}|��D]x\}}	t|�}
tj�	|d|
�}tj�
|�r=t�d||�q|
|vrIt�d||�q|	sMi}	i}|	��D]\}
}|
���
��dd	�}
|
rg|||
<qS|}	d
}gd�}|D]
}||	vr||d7}qr|t|�kr�t�d
|d�	|��q|	||
<|||
<q|��D]\}}t||�|��}t�||�q�dS)Nrz<Skipping module named %s, no 'yum_repos' configuration found�yum_repo_dirz/etc/yum.repos.d/z%s.repoz)Skipping repo %s, file %s already exists!z*Skipping repo %s, file %s already pending!r!�_r)�baseurl�metalink�
mirrorlist�z^Repository %s should contain atleast one of the following configuration entries: %s, skipping!z, )�get�LOG�debugr�get_cfg_option_strr5r%�os�pathr1�exists�info�lower�stripr"�len�warningrC�
write_file)rDrErFrG�repos�repo_base_path�repo_locations�repo_configsrr>�
canon_repo_id�repo_fn_pth�
n_repo_configr@r)�missing_required�
req_fields�	req_field�	c_repo_idrS�	repo_blobr#r#r$�handle[st
�������

��rg)�__doc__r7�loggingrR�configparserr�	cloudinitr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemar�cloudinit.settingsrr�__annotations__�	getLogger�__name__rOr-r%r'rCr/rgr#r#r#r$�<module>s(�

"
Upload File: