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

�

�f9���ddlZddlmZmZmZmZmZddlmZddlm	Z
ddlmZeje�ZGd�dej �Zy)�N)�distros�helpers�net�subp�util)�PackageList)�	rhel_util)�PER_INSTANCEc��eZdZdZdZdZdZdeed�iZdZd�Z	dd	�Z
d
�Zdd�Zd
e
fd�Zd�Zd�Zdd�Zd�Zd�Zdd�Zd�Zy)�Distroz
/etc/hostnamez/etc/systemd/network/z/etc/locale.confz/etc/systemd/resolved.conf�networkd)�resolv_conf_fn�network_conf_dirTc��tjj||||�tj|�|_d|_dg|_y)N�photon�	systemctl)rr�__init__r�Runners�_runner�osfamily�init_cmd)�self�name�cfg�pathss    �:/usr/lib/python3/dist-packages/cloudinit/distros/photon.pyrzDistro.__init__s<��������d�C��7����u�-��� ��
�$�
��
�c��tjd|�	tj||��\}}|rtjd||�d||fSd||fS#tj$rtjtd|�YywxYw)NzAttempting to run: %s)�capturez(Running %s resulted in stderr output: %sTFzCommand %s failed)TNN)�LOG�debugr�warning�ProcessExecutionErrorr�logexc)r�cmdr�out�errs     r�exec_cmdzDistro.exec_cmd(s����	�	�)�3�/�
	$����3��8�J�S�#�����>��S���S�#�~�%��#�s�?�"���)�)�	$��K�K��0�#�6�#�	$�s�7A�A�.B�Bc���d}|jj|d�}tjd||�|st	j
�Stj
d�y)N�disable_fallback_netcfgTz%s value is: %szJSkipping generate_fallback_config. Rely on PhotonOS default network config)�_cfg�getr r!r�generate_fallback_config�info)r�keyr*s   rr-zDistro.generate_fallback_config6sV��'��"&�)�)�-�-��T�":���	�	�#�S�*A�B�&��/�/�1�1����
�	
�rNc�~�|s|j}d|i}tj||�gd�}|j|�y)N�LANG)r�restartzsystemd-localed)�systemd_locale_conf_fn�rhutil�update_sysconfig_filer()r�locale�out_fn�
locale_cfgr%s     r�apply_localezDistro.apply_localeDsE����0�0�F�
�F�
�
�	�$�$�V�Z�8�
:���
�
�c�r�pkglistc�*�|jd|��y)N�install)�pkgs)�package_command)rr:s  r�install_packageszDistro.install_packagesVs�����Y�W��5rc��|r(|jd�rtj||�yd}tj|jdd�}|r"|jddt
|�g�\}}}n7|jdddt
|�g�\}}}tjd�|rtjd||f�yy)	N�/previous-hostname�create_hostname_fileT�hostnamectlzset-hostnamez--transientz7create_hostname_file is False; hostname set transientlyz3Error while setting hostname: %s
Given hostname: %s)
�endswithr�
write_file�get_cfg_option_boolr+r(�strr r.r")r�hostname�filename�retrB�_outr's       r�_write_hostnamezDistro._write_hostnameZs�����)�)�*>�?��O�O�H�h�/��C�#'�#;�#;��	�	�1�4�$� �$�!%���"�N�C��M�B�"���T�3�"&���%�&�%��H�
�	�"���T�3����M������N�� ���rc�T�|j|j�}|j|fS�N)�_read_hostname�systemd_hostname_conf_fn)r�sys_hostnames  r�_read_system_hostnamezDistro._read_system_hostname{s)���*�*�4�+H�+H�I���-�-�|�<�<rc���|r4|jd�r#tj|�j�S|j	ddg�\}}}|r|j�S|S)NrArHz-f)rDr�load_text_file�stripr()rrI�default�_retr&�_errs      rrOzDistro._read_hostnamesY����)�)�*>�?��&�&�x�0�6�6�8�8��-�-��T�(:�;���c�4�!�s�y�y�{�.�w�.rc��y)Nz	127.0.1.1��rs r�_get_localhost_ipzDistro._get_localhost_ip�s��rc�P�tj||j|���y)N)�tz�tz_file)r�set_etc_timezone�
_find_tz_file)rr^s  r�set_timezonezDistro.set_timezone�s��� � �B��0B�0B�2�0F�Grc�n�|sg}ddg}|r"t|t�r|j|�n#|r!t|t�r|j	|�|j|�tjd|�}|j	|�|j|�\}}}|rtjd|�yy)N�tdnfz-yz%s-%sz#Error while installing packages: %s)
�
isinstancerG�append�list�extendr�expand_package_listr(r �error)	r�command�argsr=r%r:rJrKr's	         rr>zDistro.package_command�s�����D��t�n���J�t�S�)��J�J�t��
�j��t�,��J�J�t���
�
�7���*�*�7�D�9���
�
�7�����s�+���T�3���I�I�;�S�A�rc�`�|jjd|jdgt��y)Nzupdate-sources�	makecache)�freq)r�runr>r
r[s r�update_package_sourceszDistro.update_package_sources�s-��������� � �
�M��		�	
r)TrN)NN)�__name__�
__module__�__qualname__rPrr3�resolve_conf_fn�renderer_configs�prefer_fqdnrr(r-r9rr?rLrRrOr\rbr>rqrZrrrrs~��.��.��/��2�O�	�-� 0�
����K�&�$���$6��6��B=�/��H�B�&
rr)�logging�	cloudinitrrrrr�cloudinit.distrosrr	r4�cloudinit.settingsr
�	getLoggerrrr rrZrr�<module>r}s=��
�7�7�)�1�+��g����!��V
�W�^�^�V
r

Zerion Mini Shell 1.0