Your IP : 216.73.217.13


Current Path : /usr/lib/python3/dist-packages/cloudinit/sources/helpers/__pycache__/
Upload File :
Current File : //usr/lib/python3/dist-packages/cloudinit/sources/helpers/__pycache__/hetzner.cpython-38.pyc

U

�Ad1�@sHddlZddlZddlmZmZddd�Zd
dd�Zeed	�d
d�ZdS)�N)�
url_helper�util��cCs6tj||||d�}|��s&td|��t�|j���S)N��timeout�sec_between�retrieszunable to read metadata at %s)r�readurl�ok�RuntimeErrorrZ	load_yaml�contents�decode�Zurlrrr	Zresponse�r�C/usr/lib/python3/dist-packages/cloudinit/sources/helpers/hetzner.py�
read_metadatas�rcCs,tj||||d�}|��s&td|��|jS)Nrzunable to read userdata at %s)rr
rrr
rrrr�
read_userdatas�r)�data�returncCsJt|t�stdt|���ztj|dd�WStjk
rD|YSXdS)z�base64 decode data

    If data is base64 encoded bytes, return b64decode(data).
    If not, return data unmodified.

    @param data: data as bytes. TypeError is raised if not bytes.
    zdata is '%s', expected bytesT)ZvalidateN)�
isinstance�bytes�	TypeError�type�base64Z	b64decode�binascii�Error)rrrr�maybe_b64decodes
r)rrr)rrr)	rrZ	cloudinitrrrrrrrrrr�<module>s