%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3.9/site-packages/cloudinit/config/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3.9/site-packages/cloudinit/config/__pycache__/cc_seed_random.cpython-39.pyc

a

'�Dg��@s�UdZddlZddlZddlmZddlmZmZddlm	Z	ddl
mZddlm
Z
ddlmZdd	lmZe�e�Zd
egegd�Ze
ed<dd
d�Zdd�Zeee	edd�dd�ZdS)z%Seed Random: Provide random seed data�N)�BytesIO)�subp�util)�Cloud)�Config)�
MetaSchema)�ALL_DISTROS)�PER_INSTANCEZcc_seed_random)�idZdistrosZ	frequencyZactivate_by_schema_keys�metacCsd|sdS|r|��dvr"t�|�S|��dvr8t�|�S|��dvrTtj|ddd�Std|��dS)N�)�raw)�base64Zb64)�gzip�gzF)�quiet�decodez Unknown random_seed encoding: %s)�lowerr�encode_textrZ	b64decodeZdecomp_gzip�IOError)�data�encoding�r�C/usr/lib/python3.9/site-packages/cloudinit/config/cc_seed_random.py�_decode s

rcCsp|s|rtd��n|s$t�d�dS|d}t�|�s\|rLtdj|d���nt�d|�dStj||dd�dS)	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_envZcapture)�
ValueError�LOG�debugr�which�format)�command�requiredrrrrr�handle_random_seed_command-s



�r$)�name�cfg�cloud�args�returnc
Cs
|�di�}|�dd�}|�dd�}t�}|rF|�t||�d�d��|jj}|rnd|vrn|�t�|d��|��}t	|�r�t
�d|t	|�|�t�||�|�d	d�}	|�d
d�}
zt
|	|
d|id
�Wn8t�y}zt
�d|	|�|�WYd}~n
d}~00dS)NZrandom_seed�filez/dev/urandomrrr)rz0%s: adding %s bytes of random seed entropy to %sr"Zcommand_requiredFZRANDOM_SEED_FILE)r"r#rz'handling random command [%s] failed: %s)�getr�writerZ
datasource�metadatarr�getvalue�lenrrZappend_filer$rZwarning)r%r&r'r(ZmycfgZ	seed_pathZ	seed_dataZseed_bufr-r"Zreq�errr�handle@s:��
r1)N)�__doc__rZlogging�iorZ	cloudinitrrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarZcloudinit.distrosrZcloudinit.settingsr	Z	getLogger�__name__rr�__annotations__rr$�str�listr1rrrr�<module>	s$
�



Zerion Mini Shell 1.0