%PDF- %PDF-
Mini Shell

Mini Shell

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

�

���f�
���UdZddlZddlZddlmZddlmZmZddlm	Z	ddl
mZddlm
Z
ddlmZdd	lmZej$e�Zd
egegd�Ze
ed<dd
�Zd�Zdedede	deddf
d�Zy)z%Seed Random: Provide random seed data�N)�BytesIO)�subp�util)�Cloud)�Config)�
MetaSchema)�ALL_DISTROS)�PER_INSTANCE�cc_seed_random)�id�distros�	frequency�activate_by_schema_keys�metac��|sy|r|j�dvrtj|�S|j�dvrtj|�S|j�dvrtj
|dd��St
d|z��)N�)�raw)�base64�b64)�gzip�gzF)�quiet�decodez Unknown random_seed encoding: %s)�lowerr�encode_textr�	b64decode�decomp_gzip�IOError)�data�encodings  �A/usr/lib/python3/dist-packages/cloudinit/config/cc_seed_random.py�_decoder" s������x�~�~�'�7�2�����%�%�	���	�.�	.�����%�%�	���	�^�	+�����E�$�?�?��8�H�E�F�Frc��|s
|rtd��|stjd�y|d}tj|�s4|rtdj|����tjd|�ytj||d��y)	Nz"no command found but required=truezno command providedrz+command '{cmd}' not found but required=true)�cmdz'command '%s' not found for seed_commandF)�
update_env�capture)�
ValueError�LOG�debugr�which�format)�command�requiredr%r$s    r!�handle_random_seed_commandr.-s���x��=�>�>�
��	�	�'�(��
�!�*�C��:�:�c�?���=�D�D��D�M��
�
�I�I�?��E���I�I�g�*�e�<r�name�cfg�cloud�args�returnc���|jdi�}|jdd�}|jdd�}t�}|r+|jt||jd����|jj
}|r+d|vr'|jt
j|d��|j�}t|�r7tjd|t|�|�t
j||�|jd	d�}	|jd
d�}
	t|	|
d|i�
�y#t$r}tjd|	|�|�d}~wwxYw)N�random_seed�filez/dev/urandomrrr )r z0%s: adding %s bytes of random seed entropy to %sr,�command_requiredF�RANDOM_SEED_FILE)r,r-r%z'handling random command [%s] failed: %s)�getr�writer"�
datasource�metadatarr�getvalue�lenr(r)�append_filer.r'�warning)r/r0r1r2�mycfg�	seed_path�	seed_data�seed_bufr<r,�req�es            r!�handlerG@s8���G�G�M�2�&�E��	�	�&�.�1�I��	�	�&�#�&�I��y�H�����w�y�5�9�9�Z�3H�I�J����(�(�H��M�X�-����t�'�'���(?�@�A��!�!�#�I�
�9�~��	�	�>���	�N��		
�	
����I�.��i�i�	�4�(�G�
�)�)�&��
.�C��"���*�I�6�	
��
�����=�w��J�����s�(D9�9	E �E�E )N)�__doc__r�logging�ior�	cloudinitrr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemar�cloudinit.distrosr	�cloudinit.settingsr
�	getLogger�__name__r(r�__annotations__r"r.�str�listrG�rr!�<module>rWs���,�
��� �!�#�.�)�+��g����!����}��!�	��j��
G�=�&#��#�6�#�%�#�t�#��#r

Zerion Mini Shell 1.0