File: //usr/lib/python3/dist-packages/uaclient/clouds/__pycache__/gcp.cpython-310.pyc
o
0xvct � @ s� d dl Z d dlZd dlZd dlZd dlmZmZmZmZ d dl m
Z
d dlmZm
Z
mZmZ d dlmZ e�d�ZdZdZd Zd
ZdZdZd
dddd�ZG dd� de�ZdS )� N)�Any�Dict�List�Optional)� HTTPError)�
exceptions�messages�system�util)�AutoAttachCloudInstancezpro.clouds.gcpz�http://metadata/computeMetadata/v1/instance/service-accounts/default/identity?audience=contracts.canonical.com&format=full&licenses=TRUEzThttp://metadata.google.internal/computeMetadata/v1/instance/licenses/?recursive=truez&wait_for_change=truez&last_etag={etag}z/sys/class/dmi/id/product_namezGoogle Compute Engine�8045211386737108299�6022427724719891830�599959289349842382�2592866803419978320)�xenial�bionic�focal�jammyc @ s� e Zd Zdd� Zeejejg d�d�de e
ef fdd���Zede
fdd ��Z
edefd
d��Zdee
fdd
�Zdefdd�Zdedefdd�ZdS )�UAAutoAttachGCPInstancec C s
d | _ d S )N��etag��self� r �5/usr/lib/python3/dist-packages/uaclient/clouds/gcp.py�__init__% s
z UAAutoAttachGCPInstance.__init__)g �?� r )�retry_sleeps�returnc
C s� zddi}t jt|dd�\}}W d
|iS typ } zQt|dd �}d }|rCz
tj|t jd�}W n ty: d }Y nw |rC|� dd �}|rG|n|j
}d } |r`d|�� v r`tj
jj|d �}tj
j} tj|| t|d
d�d��d }~ww )N�Metadata-Flavor�Googler )�headers�timeout�body)�cls�error_descriptionzservice account)� error_msg�coder )�msg�msg_coder'