/usr/lib/python3/dist-packages/landscape/lib/__pycache__
Edit: /usr/lib/python3/dist-packages/landscape/lib/__pycache__/cloud.cpython-310.pyc (1861B)
o
c @ s6 d dl mZ dZdef ZdZd
ddZd
dd ZdS ) )fetch_asyncz169.254.169.254zhttp://%s/latest@ Nc sR g t d }| fdd | fdd fdd}|| |S )zFetch 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_itemignore
cloud_datafetch 5/usr/lib/python3/dist-packages/landscape/lib/cloud.py
z%fetch_ec2_meta_data..c r )Nami-idr r r r r r r c s* dd } \}}}||||||dS )z1Record the instance data returned by the EC2 API.c S s, | d urt | tr| d} | d t S d S )Nzutf-8)
isinstancebytesdecode
MAX_LENGTH)valuer r r _process_result s
zCfetch_ec2_meta_data..return_result.._process_result)r r r r )r
r instance_id
instance_typeami_id)r r r
return_result s
z*fetch_ec2_meta_data..return_result)r addCallback)r
deferredr r r r fetch_ec2_meta_data s
r c C s, t d | }|du rt}||dd|jS )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 s