🔐 Sid Gifari File Manager Pro
v8.0.5 | 2026-08-07 12:23:13 | PHP 8.2.32
📂
/ (Root)
/
usr
/
lib
/
python3.6
/
site-packages
/
cloudinit
/
config
/
__pycache__
📍 /usr/lib/python3.6/site-packages/cloudinit/config/__pycache__
🔄 Refresh
✏️
Editing: cc_yum_add_repo.cpython-36.pyc
Read Only
3 \�me� � @ s< U d Z ddlZddlZddlZddlmZ ddlmZ ddlm Z ddl mZ ddlm Z ddlmZmZ dd lmZ d Zddd dddddddddddgZdZdZdZdddeeed�ede� d e� d!��ed"e� d#��ed$�ged%gd&�Zeee�Z eje�Zeed'�d(d)�Zd*d+� Zd,d-� Zee ee dd.�d/d0�Z!dS )1z<Yum Add Repo: Add yum repository configuration to the system� N)�ConfigParser)�dedent)�util)�Cloud)�Config)� MetaSchema�get_meta_doc)�PER_INSTANCEa Add yum repository configuration to ``/etc/yum.repos.d``. Configuration files are named based on the opaque dictionary key under the ``yum_repos`` they are specified with. If a config file already exists with the same name as a config entry, the config entry will be skipped. Z almalinuxZcentosZ cloudlinuxZ eurolinuxZfedoraZmarinerZ openeulerZOpenCloudOSZopenmandrivaZphotonZrhelZrockyZ TencentOSZ virtuozzoz_https://download.copr.fedorainfracloud.org/results/@cloud-init/cloud-init-dev/epel-8-$basearch/zXhttps://download.copr.fedorainfracloud.org/results/@cloud-init/cloud-init-dev/pubkey.gpgZcc_yum_add_repozYum Add Repoz.Add yum repository configuration to the systemz� yum_repos: my_repo: baseurl: http://blah.org/pub/epel/testing/5/$basearch/ yum_repo_dir: /store/custom/yum.repos.d a, # Enable cloud-init upstream's daily testing repo for EPEL 8 to # install latest cloud-init from tip of `main` for testing. yum_repos: cloud-init-daily: name: Copr repo for cloud-init-dev owned by @cloud-init baseurl: z type: rpm-md skip_if_unavailable: true gpgcheck: true gpgkey: z1 enabled_metadata: 1 a # Add the file /etc/yum.repos.d/epel_testing.repo which can then # subsequently be used by yum for later operations. yum_repos: # The name of the repository epel-testing: baseurl: z� enabled: false failovermethod: priority gpgcheck: true gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL name: Extra Packages for Enterprise Linux 5 - Testing a� # Any yum repo configuration can be passed directly into # the repository file created. See: man yum.conf for supported # config keys. # # Write /etc/yum.conf.d/my-package-stream.repo with gpgkey checks # on the repo data of the repository enabled. yum_repos: my package stream: baseurl: http://blah.org/pub/epel/testing/5/$basearch/ mirrorlist: http://some-url-to-list-of-baseurls repo_gpgcheck: 1 enable_gpgcheck: true gpgkey: https://url.to.ascii-armored-gpg-key � yum_repos)�id�name�title�description�distrosZexamplesZ frequencyZactivate_by_schema_keys)�repo_id�returnc C s | j dd�S )af Canonicalize 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 �%/usr/lib/python3.6/cc_yum_add_repo.py�_canonicalize_id� s r c C sN t | t�rtt| ��S t | ttf�r8djdd� | D ��S t | t�sJt| �S | S )N� c S s g | ]}t |��qS r )�_format_repo_value)�.0�vr r r � <listcomp>� s z&_format_repo_value.<locals>.<listcomp>)� isinstance�bool�str�int�list�tuple�join)�valr r r r � s r c C sz t � }|j| � x&|j� D ]\}}|j| |t|�� qW tj� }|j|� |jd� |j � }|j ddtj� � dj |�S )Nr z# Created by cloud-init on %s � )r Zadd_section�items�setr �io�StringIO�write�seek� readlines�insertr Ztime_rfc2822r# )r �repo_configZto_be�kr Zto_be_stream�linesr r r �_format_repository_config� s r1 )r �cfg�cloud�argsr c C sp |j d�}|stjd| � d S tj|dd�}i }i }�x |j� D ]�\}} t|�} tjj |d| �}tjj |�r�tjd||� q@n| |kr�tjd||� q@| s�i } i }x4| j� D ](\} }| j� j � jdd �} | r�||| <