%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/cloudinit/distros/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/cloudinit/distros/__pycache__/rhel.cpython-312.pyc

�

���f����ddlZddlZddlmZmZmZmZddlmZm	Z	ddl
mZddlm
Z
mZeje�ZGd�dej$�Zy)�N)�distros�helpers�subp�util)�PackageList�	rhel_util)�HostnameConf)�
PER_ALWAYS�PER_INSTANCEc��eZdZdZdZdZdZdZdZdZ	dZ
dZd	Zd
ddd
dd�d�iZ
dZd�Zdefd�Zd�Zd!d�Zd"d�Zd�Zd�Zd!d�Zd�Zd#d�Zdd�d �Zy)$�Distroz/etc/sysconfig/clockz/etc/sysconfig/i18nz/etc/locale.confz/etc/sysconfig/networkz
/etc/hostnamez/etc/localtimez/usr/libexecz/var/lib/NetworkManagerzdhclient-[\w-]+\.lease�	sysconfigzetc/sysconfig/networkz'%(base)s/network-scripts/ifcfg-%(name)sz'%(base)s/network-scripts/route-%(name)sz(%(base)s/network-scripts/route6-%(name)s)�ipv4�ipv6)�control�iface_templates�route_templatesTc��tjj||||�tj|�|_d|_d|_d|_d|d<y)N�redhatzen_US.UTF-8�sshd�ssh_svcname)	rr
�__init__r�Runners�_runner�osfamily�default_locale�
system_locale)�self�name�cfg�pathss    �8/usr/lib/python3/dist-packages/cloudinit/distros/rhel.pyrzDistro.__init__4sM��������d�C��7����u�-��� ��
�+���!���#��M���pkglistc�*�|jd|��y)N�install)�pkgs)�package_command)rr$s  r"�install_packageszDistro.install_packages?s�����Y�W��5r#c��|js|j�|_|jr|jS|jS)z8Return the default locale if set, else use system locale)r�_read_system_localer)rs r"�
get_localezDistro.get_localeBsD���!�!�!%�!9�!9�!;�D��#'�"4�"4�D���	
�:>�:M�:M�	
r#Nc��|j�r|s|j}n|s|j}d|i}tj||�y)N�LANG)�uses_systemd�systemd_locale_conf_fn�locale_conf_fnr�update_sysconfig_file)r�locale�out_fn�
locale_cfgs    r"�apply_localezDistro.apply_localeNsH��������4�4����,�,���F�
�
�	�'�'��
�;r#c��|j�r
|j}n|j}|std|z��tj
j
|�r"tj|�\}}||vr||Syy)z.Read system default locale setting, if presentzInvalid path: %sN)	r/r0r1�
ValueError�os�path�existsr�read_sysconfig_file)r�keyname�	locale_fn�_exists�contentss     r"r+zDistro._read_system_localeZsx�������3�3�I��+�+�I���/�)�;�<�<�
�7�7�>�>�)�$�"+�"?�"?�	�"J��W�h��(�"���(�(��%r#c��|j�rN|jd�r=td�}|j|�t	j
|t
|�d�y|j�r}t	j|jdd�}|r"tjddt
|�g�ytjdddt
|�g�tjd	�yd
|i}tj||�y)N�/previous-hostname�i��create_hostname_fileT�hostnamectlzset-hostnamez--transientz7create_hostname_file is False; hostname set transiently�HOSTNAME)r/�endswithr	�set_hostnamer�
write_file�str�get_cfg_option_bool�_cfgr�LOG�inforr2)r�hostname�filename�confrD�host_cfgs      r"�_write_hostnamezDistro._write_hostnameks�������8�#4�#4�5I�#J���#�D����h�'��O�O�H�c�$�i��7�
�
�
�
 �#'�#;�#;��	�	�1�4�$� �$��	�	�=�.�#�h�-�H�I��	�	�%�&�%��H�
�	�����M��
�H��H�
�+�+�H�h�?r#c�z�|j�r
|j}n|j}||j|�fS�N)r/�systemd_hostname_conf_fn�hostname_conf_fn�_read_hostname)r�host_fns  r"�_read_system_hostnamezDistro._read_system_hostname�s:�������3�3�G��+�+�G���,�,�W�5�6�6r#c�`�|j�r4|jd�r#tj|�j	�S|j�r8tj
dg�\}}|j	�}t
|�r|S|Stj|�\}}d|vr|dS|S)NrBrOrF)	r/rGr�load_text_file�stripr�lenrr<)rrP�default�out�_errr?r@s       r"rXzDistro._read_hostname�s�������8�#4�#4�5I�#J��&�&�x�0�6�6�8�8�
�
�
�
 ��)�)�Z�L�1�K�S�$��)�)�+�C��3�x��
���"+�"?�"?��"I��W�h��X�%��
�+�+��r#c�`�|j|�}|j�r@tj|j�tj
||j�ydt
|�i}tj|j|�tj||j�y)N�ZONE)�
_find_tz_filer/r�del_file�tz_local_fn�sym_linkrJrr2�
clock_conf_fn�copy)r�tz�tz_file�	clock_cfgs    r"�set_timezonezDistro.set_timezone�s����$�$�R�(������
�M�M�$�*�*�+��M�M�'�4�#3�#3�4���B���I�
�+�+�D�,>�,>�	�J��I�I�g�t�/�/�0r#c���|�g}tjd�rtjd�dg}ntjd�ddg}|j	d�|r"t|t�r|j	|�n#|r!t|t�r|j|�|j	|�tjd|�}|j|�tj|d�	�y)
N�dnfz Using DNF for package managementz Using YUM for package management�yumz-tz-yz%s-%sF)�capture)r�whichrM�debug�append�
isinstancerJ�list�extendr�expand_package_list)r�command�argsr'�cmdr$s      r"r(zDistro.package_command�s����<��D��:�:�e���I�I�8�9��'�C��I�I�8�9��$�-�C�	�
�
�4���J�t�S�)��J�J�t��
�j��t�,��J�J�t���
�
�7���*�*�7�D�9���
�
�7��	
�	�	�#�u�%r#F)�forcec�|�|jjd|jdg|rt��yt��y)Nzupdate-sources�	makecache)�freq)r�runr(r
r)rr|s  r"�update_package_sourceszDistro.update_package_sources�s>��������� � �
�M�$��		�	
�+7�		�	
r#rU)r.)NN)�__name__�
__module__�__qualname__rhr1r0�network_conf_fnrWrVrf�usr_lib_exec�dhclient_lease_directory�dhclient_lease_file_regex�renderer_configs�prefer_fqdnrrr)r,r6r+rSrZrXrmr(r��r#r"r
r
s���*�M�*�N�/��.�O�/��.��"�K�!�L�
 9�� 9���.�H�A�B� �
�	���K�	$�6��6�

�
<��"@�>7��"1� &�B/4�
r#r
)�loggingr9�	cloudinitrrrr�cloudinit.distrosrr�"cloudinit.distros.parsers.hostnamer	�cloudinit.settingsr
r�	getLoggerr�rMr
r�r#r"�<module>r�s@���	�2�2�4�;�7��g����!��D
�W�^�^�D
r#

Zerion Mini Shell 1.0