Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3/dist-packages/sos/report/plugins/__pycache__/ |
Upload File : |
o ���bZ � @ sb d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dl m Z mZmZ G dd� de e�Z dS ) � N)�HTTPResponse)�Any)�request)�URLError)�Plugin�IndependentPlugin� PluginOptc @ s� e Zd ZdZdZdZedddd�gZdZd Z d Z dZdd � Zdd� Z defdd�Zededefdd��Zdd� Zededefdd��ZdS )�GCPzGoogle Cloud Platform�gcp)�virt�keep-piiFzyStop the plugin from removing PIIs like project name or organization ID from the metadata retrieved from Metadata server.)�default�descz3http://metadata.google.internal/computeMetadata/v1/zBhttp://metadata.google.internal/computeMetadata/v1/?recursive=truez[--REDACTED--]zDDMI: Google Google Compute Engine/Google Compute Engine, BIOS Googlec C s( | � d�}|d dkr dS | j|d v S )z� Checks if this plugin should be executed at all. In this case, it will check the `dmesg` command output to see if the system is running on a Google Cloud Compute instance. �dmesg�statusr F�output)�exec_cmd� GOOGLE_DMI)�selfr � r �8/usr/lib/python3/dist-packages/sos/report/plugins/gcp.py� check_enabled( s zGCP.check_enabledc C s� | j ddgd� z| �� | _| �� | jtj| jdd�dddgd� W n tyA } z| jt|�dddgd� W Y d }~nd }~ww | j d dgd� d S )z� Collect the following info: * Metadata from the Metadata server * `gcloud auth list` output * Any google services output from journal zgcloud auth listr )�tags� )�indentz metadata.jsonT)�plug_dirr Nzgoogle*)�unitsr ) �add_cmd_output�get_metadata�metadata�scrub_metadata�add_string_as_file�json�dumps�RuntimeError�str�add_journal)r �errr r r �setup3 s ����z GCP.setup�returnc C s"