| Server IP : 156.238.232.47 / Your IP : 216.73.216.150 Web Server : nginx/1.25.3 System : Linux C202504152095410 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : www ( 1000) PHP Version : 8.3.25 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib/python2.7/site-packages/cloudinit/config/ |
Upload File : |
�
oB�]c @ s� d Z d d l Z y d d l m Z Wn! e k
rI d d l m Z n Xd d l Z d d l m Z d d g Z d � Z d � Z
d � Z d
� Z d S( s�
Yum Add Repo
------------
**Summary:** add yum repository configuration to the system
Add yum repository configuration to ``/etc/yum.repos.d``. Configuration files
are named based on the 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.
**Internal name:** ``cc_yum_add_repo``
**Module frequency:** per always
**Supported distros:** fedora, rhel
**Config keys**::
yum_repos:
<repo-name>:
baseurl: <repo url>
name: <repo name>
enabled: <true/false>
# any repository configuration options (see man yum.conf)
i����N( t ConfigParser( t utilt fedorat rhelc C s. | j � j d d � } | j d d � } | S( Nt -t _t ( t lowert replace( t repo_id( ( sD /usr/lib/python2.7/site-packages/cloudinit/config/cc_yum_add_repo.pyt _canonicalize_id. s c C sz t | t � r t t | � � St | t t f � rZ d j g | D] } t | � ^ qA � St | t j � sv t | � S| S( Ns
(
t
isinstancet boolt strt intt listt tuplet joint _format_repo_valuet sixt string_types( t valt v( ( sD /usr/lib/python2.7/site-packages/cloudinit/config/cc_yum_add_repo.pyR 4 s &
c C s� t � } | j | � x3 | j � D]% \ } } | j | | t | � � q# Wt j � } | j | � | j d � | j � } | j
d d t j � � d j
| � S( Ni s # Created by cloud-init on %s
t ( R t add_sectiont itemst setR R t StringIOt writet seekt readlinest insertR t time_rfc2822R ( R t repo_configt to_bet kR t to_be_streamt lines( ( sD /usr/lib/python2.7/site-packages/cloudinit/config/cc_yum_add_repo.pyt _format_repository_configC s
c C s | j d � } | s) | j d | � d St j | d d � } i } i } xn| j � D]`\ } }
t | � } t j j | d | � } t j j | � r� | j
d | | � qW n% | | k r� | j
d | | � qW n |
s� i }
n i }
xK |
j � D]= \ } } | j � j � j
d d � } | r� | |
| <q� q� W|
}
d
} x= d g D]2 } | |
k rQ| j d | | � | d
7} qQqQW| s�|
| | <| | | <qW | j d | | � qW WxB | j � D]4 \ } } t | | j | � � } t j | | � q�Wd S( Nt yum_reposs<