HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/root/lib/python3/dist-packages/landscape/lib/__pycache__/cloud.cpython-38.pyc
U

���c��@s6ddlmZdZdefZdZd
dd�Zddd	�ZdS)�)�fetch_asyncz169.254.169.254zhttp://%s/latest�@NcsRg�td���}|���fdd��|���fdd���fdd�}|�|�|S)z�Fetch EC2 information about the cloud instance.

    The fetch parameter provided above is for non-mocked testing purposes.
    �instance-idcstd���S)N�
instance-type��_fetch_ec2_item��ignore��
cloud_data�fetch��5/usr/lib/python3/dist-packages/landscape/lib/cloud.py�<lambda>�z%fetch_ec2_meta_data.<locals>.<lambda>cstd���S)N�ami-idrrr
r
rrrcs*dd�}�\}}}||�||�||�d�S)z1Record the instance data returned by the EC2 API.cSs,|dk	r(t|t�r|�d�}|dt�SdS)Nzutf-8)�
isinstance�bytes�decode�
MAX_LENGTH)�valuer
r
r�_process_results

zCfetch_ec2_meta_data.<locals>.return_result.<locals>._process_result)rrrr
)r	rZinstance_idZ
instance_typeZami_id)rr
r�
return_results
�z*fetch_ec2_meta_data.<locals>.return_result)r�addCallback)rZdeferredrr
r
r�fetch_ec2_meta_datas��
rcCs,td|}|dkrt}||dd��|j�S)z�
     Get data at C{path} on the EC2 API endpoint, and add the result to the
    C{accumulate} list. The C{fetch} parameter is provided for testing only.
    z/meta-data/NF)Zfollow)�EC2_APIrr�append)�path�
accumulaterZurlr
r
rr(sr)N)N)Zlandscape.lib.fetchrZEC2_HOSTrrrrr
r
r
r�<module>s