HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-10-0-8-47 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:31:58 UTC 2024 aarch64
User: ubuntu (1000)
PHP: 8.1.2-1ubuntu2.22
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/cloudinit/sources/helpers/__pycache__/hetzner.cpython-310.pyc
o

�Ad1�@sJddlZddlZddlmZmZd
dd�Zd
dd�Zd	ed
efdd�ZdS)�N)�
url_helper�util��cCs6tj||||d�}|��std|��t�|j���S)N��timeout�sec_between�retrieszunable to read metadata at %s)r�readurl�ok�RuntimeErrorr�	load_yaml�contents�decode��urlrrr	�response�r�C/usr/lib/python3/dist-packages/cloudinit/sources/helpers/hetzner.py�
read_metadatas�rcCs,tj||||d�}|��std|��|jS)Nrzunable to read userdata at %s)rr
rrrrrrr�
read_userdatas�r�data�returncCsDt|t�s
tdt|���ztj|dd�WStjy!|YSw)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)�validate)�
isinstance�bytes�	TypeError�type�base64�	b64decode�binascii�Error)rrrr�maybe_b64decodes
�r")rrr)	rr �	cloudinitrrrrrr"rrrr�<module>s