%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__/gentoo.cpython-312.pyc

�

�f���ddlZddlmZmZmZmZddlmZddlm	Z	ddl
mZeje
�ZGd�dej�Zy)�N)�distros�helpers�subp�util)�PackageList)�HostnameConf)�PER_INSTANCEc�r�eZdZdZdZdZddgZd�Zdd�Zd	e	fd
�Z
d�Zd�Ze
d
��Zdd�Zd�Zdd�Zd�Zy)�Distroz/etc/locale.genz/etc/conf.d/hostnamezen_US.UTF-8zC.UTF8 UTF-8zen_US.UTF-8 UTF-8c���tjj||||�tj|�|_d|_d|d<tj�rtjd�yy)N�gentooz/etc/init.d/sshd�ssh_svcnamez/Cloud-init does not support systemd with gentoo)
rr�__init__r�Runners�_runner�osfamily�uses_systemd�LOG�error)�self�name�cfg�pathss    �:/usr/lib/python3/dist-packages/cloudinit/distros/gentoo.pyrzDistro.__init__s[��������d�C��7����u�-��� ��
�/��M�����!��I�I�G�H�"�Nc���tj|jdj|j�d��tj
dgd��tj
ddd	|jgd��y
)z�rc-only - not compatible with systemd

        Locales need to be added to /etc/locale.gen and generated prior
        to selection. Default to en_US.UTF-8 for simplicity.
        �
i�)�modez
locale-genF��capture�eselect�locale�setN)r�
write_file�
locale_gen_fn�join�localesr�default_locale)r�_�out_fns   r�apply_localezDistro.apply_locale(s[��	
����*�*�D�I�I�d�l�l�,C�#�N�	
�	�	�<�.�%�0�	
�	�	�
��%��)<�)<�=�u�	
r�pkglistc�J�|j�|jd|��y)N�)�pkgs)�update_package_sources�package_command)rr,s  r�install_packageszDistro.install_packages8s!���#�#�%����R�g��.rc�B�d}	|j|�}|std�}|jd|z�tj|t|�d�y#t$r>tj|jdd�}|rnt
j
d�YyY��wxYw)N�create_hostname_fileTz8create_hostname_file is False; hostname file not createdr.z
hostname="%s"i�)�_read_hostname_conf�IOErrorr�get_cfg_option_bool�_cfgr�infor�set_hostnamer$�str)r�hostname�filename�confr4s     r�_write_hostnamezDistro._write_hostname<s�����	��+�+�H�5�D����#�D�
	
���/�H�4�5�����#�d�)�U�3��%�
	�#'�#;�#;��	�	�1�4�$� �$�����N����
	�s�A�AB�Bc�T�|j|j�}|j|fS�N)�_read_hostname�hostname_conf_fn)r�sys_hostnames  r�_read_system_hostnamezDistro._read_system_hostnameVs)���*�*�4�+@�+@�A���$�$�l�2�2rc�b�ttj|��}|j�|SrA)rr�load_text_file�parse)r=r>s  rr5zDistro._read_hostname_confZs%���D�/�/��9�:���
�
���rc�l�d}	|j|�}|j}|s|S|S#t$rY�wxYwrA)r5r<r6)rr=�defaultr<r>s     rrBzDistro._read_hostname`sH����	��+�+�H�5�D��}�}�H���N����	�	��	�s�'�	3�3c�P�tj||j|���y)N)�tz�tz_file)r�set_etc_timezone�
_find_tz_file)rrLs  r�set_timezonezDistro.set_timezoneks��� � �B��0B�0B�2�0F�Grc��dg}|jd�|dk(r|jddg�n�|�g}|r"t|t�r|j|�n#|r!t|t�r|j|�|r|j|�tjd|�}|j|�tj|d��y)	N�emergez--quiet�upgradez--update�worldz%s-%sFr)�append�extend�
isinstancer;�listr�expand_package_listr)r�command�argsr/�cmdr,s      rr1zDistro.package_commandns����j���
�
�9���i���J�J�
�G�,�-��|����
�4��-��
�
�4� ��*�T�4�0��
�
�4� ���
�
�7�#��.�.�w��=�G��J�J�w��	
�	�	�#�u�%rc�`�|jjd|jdgt��y)Nzupdate-sourcesz--sync)�freq)r�runr1r	)rs rr0zDistro.update_package_sources�s-��������� � �
�J��		�	
rrA)NN)�__name__�
__module__�__qualname__r%rCr(r'rr+rr2r?rE�staticmethodr5rBrPr1r0�rrrrsi��%�M�-��"�N��2�3�G�
I�
� /��/�4�43�����
	�H�&�2
rr)�logging�	cloudinitrrrr�cloudinit.distrosr�"cloudinit.distros.parsers.hostnamer�cloudinit.settingsr	�	getLoggerr`rrrdrr�<module>rks=���2�2�)�;�+��g����!��z
�W�^�^�z
r

Zerion Mini Shell 1.0