HOME


Mini Shell 1.0
DIR: /lib/python3/dist-packages/landscape/lib/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/landscape/lib/__pycache__/cloud.cpython-312.pyc
�

�~�e���4�ddlmZdZde�d�ZdZd	d�Zd	d�Zy)
�)�fetch_asyncz169.254.169.254zhttp://z/latest�@Nc����g�td���}|j��fd��|j��fd���fd�}|j|�|S)z�Fetch EC2 information about the cloud instance.

    The fetch parameter provided above is for non-mocked testing purposes.
    �instance-idc���td���S)N�
instance-type��_fetch_ec2_item��ignore�
cloud_data�fetchs ���5/usr/lib/python3/dist-packages/landscape/lib/cloud.py�<lambda>z%fetch_ec2_meta_data.<locals>.<lambda>s�����
�E�J��c���td���S)N�ami-idr	rs ��rrz%fetch_ec2_meta_data.<locals>.<lambda>s����x��U�C�rc�F��d�}�\}}}||�||�||�d�S)z1Record the instance data returned by the EC2 API.c�\�|�*t|t�r|jd�}|dtSy)Nzutf-8)�
isinstance�bytes�decode�
MAX_LENGTH)�values r�_process_resultzCfetch_ec2_meta_data.<locals>.return_result.<locals>._process_results2��� ��e�U�+�!�L�L��1�E��[�j�)�)�!r)rrr�)rr�instance_id�
instance_type�ami_idr
s     �r�
return_resultz*fetch_ec2_meta_data.<locals>.return_results8���	*�0:�,��m�V�*�;�7�%�f�-�,�]�;�
�	
r)r
�addCallback)r�deferredr r
s`  @r�fetch_ec2_meta_datar#sX���
�J��}�j�%�@�H����J��
���C��
� 
����'��Orc�p�tdz|z}|�t}||d��j|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/F)�follow)�EC2_APIrr!�append)�path�
accumulater�urls    rr
r
,s;��
�M�
!�D�
(�C��}�����U�#�/�/�
�0A�0A�B�Br)N)�landscape.lib.fetchr�EC2_HOSTr&rr#r
rrr�<module>r-s,��+����H�:�W�
%��
�
�!�HCr