![]() Server : Apache/2.4.52 (Ubuntu) System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64 User : www-data ( 33) PHP Version : 8.1.2-1ubuntu2.21 Disable Function : NONE Directory : /lib/python3/dist-packages/landscape/lib/__pycache__/ |
o ���c� � @ s6 d dl mZ dZdef ZdZd dd�Zd dd �ZdS )� )�fetch_asyncz169.254.169.254zhttp://%s/latest�@ Nc sR g � t d� ��}|�� �fdd�� |�� �fdd�� � fdd�}|�|� |S )z�Fetch EC2 information about the cloud instance. The fetch parameter provided above is for non-mocked testing purposes. �instance-idc � t d� ��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>c r )N�ami-idr r r r r r r c s* dd� }� \}}}||�||�||�d�S )z1Record the instance data returned by the EC2 API.c S s, | d urt | t�r| �d�} | d t� S d S )Nzutf-8)� isinstance�bytes�decode� MAX_LENGTH)�valuer r r �_process_result s �zCfetch_ec2_meta_data.<locals>.return_result.<locals>._process_result)r r r r )r r �instance_id� instance_type�ami_id)r r r � return_result s �z*fetch_ec2_meta_data.<locals>.return_result)r �addCallback)r �deferredr r r r �fetch_ec2_meta_data s �� r c C s, t d | }|du rt}||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)�follow)�EC2_APIr r �append)�path� accumulater �urlr r r r ( s r )N)�landscape.lib.fetchr �EC2_HOSTr! r r r r r r r �<module> s