Current Dir: /snap/core22/2955/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/2955/usr/lib/python3/dist-packages/cloudinit/config/__pycache__/cc_zypper_add_repo.cpython-310.pyc

o

��i��
@s�UdZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlm
Z
dgd	�e
d
gd�Zeed<e�e�Zd
d�Zdd�Zdd�Zdd�Zdd�Zdede	dededdf
dd�ZdS)z6zypper_add_repo: Add zypper repositories to the system�N)�util)�Cloud)�Config)�
MetaSchema)�
PER_ALWAYS�cc_zypper_add_repo)�opensusezopensuse-microoszopensuse-tumbleweedz
opensuse-leap�sle_hpcz	sle-micro�sles�zypper)�id�distros�	frequency�activate_by_schema_keys�metacCs|�dd�}|S)N� �_)�replace)�repo_id�r�E/usr/lib/python3/dist-packages/cloudinit/config/cc_zypper_add_repo.py�_canonicalize_id%srcCsNt|t�r|r	dSdSt|ttf�rd�dd�|D��St|t�s%t|�S|S)N�rz
    cSsg|]}t|��qSr)�_format_repo_value)�.0�vrrr�
<listcomp>/sz&_format_repo_value.<locals>.<listcomp>)�
isinstance�bool�list�tuple�join�str)�valrrrr*s

rcCsDt��}i||<|��D]\}}t|�|||<q|��}d�|�S)N�
)�	configobj�	ConfigObj�itemsr�writer!)r�repo_config�to_be�kr�linesrrr�_format_repository_config5s
r-c
Cs|sdSi}t|�D]f\}}tddg��t|��}|r&t�d|d�|��q
|�d�}t|�}tj	�|d|�}tj	�
|�rFt�d||�q
||vrRt�d||�q
td	d
�|�
�D��}	dD]
}
|
|	vrid|	|
<q_||	f||<q
|�
�D]\}}t||d
�}t�|d|�qudS)z�Write the user-provided repo definition files
    @param repos: A list of repo dictionary objects provided by the user's
        cloud config.
    @param repo_base_path: The directory path to which repo definitions are
        written.
    Nr�baseurlz;Repo config at index %d is missing required config keys: %s�,z%s.repoz)Skipping repo %s, file %s already exists!z*Skipping repo %s, file %s already pending!css8�|]\}}|r|dkr|�����dd�|fVqdS)r�-rN)�lower�stripr)rr+rrrr�	<genexpr>is����z_write_repos.<locals>.<genexpr>)�enabled�autorefresh�1���r)�	enumerate�set�
difference�LOG�warningr!�getr�os�path�exists�info�dictr'r-r�
write_file)
�repos�repo_base_path�valid_repos�index�user_repo_config�missing_keysr�
canon_repo_id�repo_fn_pthr)�field�	repo_data�	repo_blobrrr�_write_reposAsR�
�����rOcCs�|sdSd}t�|�}dg}|��D]\}}|dkr&d}|d7}t�|�q|r1|�d||f�qt|�dkr@|d	�|�}n|}t�||�dS)
z@Write to the default zypp configuration file /etc/zypp/zypp.confNz/etc/zypp/zypp.confz# Added via cloud.cfg�	configdirz5Changing the location of the zypper configuration is z+not supported, skipping "configdir" settingz%s=%srr$)	r�load_text_filer'r;r<�append�lenr!rC)�
zypper_config�zypp_config�zypp_conf_content�new_settings�setting�value�msg�
new_configrrr�_write_zypp_config{s$

�r\�name�cfg�cloud�args�returncCsj|�d�}|st�d|�dS|�d�}|st�d|�dS|�di�}|�dd�}t|�t||�dS)NrzBSkipping module named %s, no 'zypper' relevant configuration foundrDz8Skipping module named %s, no 'repos' configuration found�config�reposdirz/etc/zypp/repos.d/)r=r;�debugr\rO)r]r^r_r`�zypper_sectionrDrTrErrr�handle�s"
�
�rf)�__doc__�loggingr>r%�	cloudinitr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemar�cloudinit.settingsrr�__annotations__�	getLogger�__name__r;rrr-rOr\r"rrfrrrr�<module>s*	�
:"
Upload File: