File manager - Edit - /usr/lib/python3/dist-packages/cloudinit/sources/helpers/__pycache__/hetzner.cpython-310.pyc
Back
o �Ad1 � @ sJ d dl Z d dlZd dlmZmZ d dd�Zd dd�Zd ed efdd�ZdS )� N)� url_helper�util� � c C s6 t j| |||d�}|�� std| ��t�|j�� �S )N��timeout�sec_between�retrieszunable to read metadata at %s)r �readurl�ok�RuntimeErrorr � load_yaml�contents�decode��urlr r r �response� r �C/usr/lib/python3/dist-packages/cloudinit/sources/helpers/hetzner.py� read_metadata s �r c C s, t j| |||d�}|�� std| ��|jS )Nr zunable to read userdata at %s)r r r r r r r r r � read_userdata s �r �data�returnc C sD t | t�s tdt| � ��ztj| dd�W S tjy! | Y S w )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)r r r r �maybe_b64decode s �r"