Current File : //usr/lib/python3/dist-packages/cloudinit/__pycache__/apport.cpython-312.pyc |
�
x[h0! � � � d Z ddlZddlZddlZddlmZ ddlmZmZ ddl m
Z
ddlmZm
Z
mZmZ dZg d �Zdd
�Zdd�Zdd�Zdd
�Zddefd�Zd� Zd� Zdeeef fd�Zdeeef fd�Zeed�Zdeddfd�Zdd�Z y# e$ r dZY �Rw xY w)zCloud-init apport interface� N)�Dict)�INSTALLER_APPORT_FILES� INSTALLER_APPORT_SENSITIVE_FILES)�is_cloud_init_enabled)�attach_file�attach_file_if_exists�attach_root_command_outputs�root_command_outputTF)&�AliYun�AltCloud�AkamaizAmazon - Ec2�Azure�Bigstep� Brightbox�CloudCIX�
CloudSigma�
CloudStack�DigitalOcean�E24CloudzGCE - Google Compute EnginezHuawei Cloud�Exoscalez
Hetzner Cloud�NWCSz IBM - (aka SoftLayer or BlueMix)�LXD�MAAS�NoCloud�
OpenNebula� OpenStack�Oracle�OVFz'RbxCloud - (HyperOne, Rootbox, Rubikon)�OpenTelekomCloudzSamsung Cloud PlatformzSAP Converged Cloud�Scaleway�SmartOS�UpCloud�VMware�Vultr�ZStack�Outscale�WSL�Otherc �~ � t | ddi� g d�}|s|j d� t |� t | dd� y)zBAttach cloud-init logs and tarfile from 'cloud-init collect-logs'.zcloud-init-log-warningsz-egrep -i "warn|error" /var/log/cloud-init.log)z
cloud-initzcollect-logsz-t�/tmp/cloud-init-logs.tgzz--redactr* zlogs.tgzN)r �appendr
r )�report�ui�include_sensitive�commands �2/usr/lib/python3/dist-packages/cloudinit/apport.py�attach_cloud_init_logsr1 I sE � ���%�?�
���G� ����z�"��� ���2�J�?� c �N � d}|r!|j |� rt | ddi� yyy)z*Optionally attach hardware info from lshw.z�Your device details (lshw) may be useful to developers when addressing this bug, but gathering it requires admin privileges. Would you like to include this info?zlshw.txt�lshwN)�yesnor )r, r- �prompts r0 �
attach_hwinfor7 _ s2 � � 0� �
�b�h�h�v��#�F�Z��,@�A� �rr2 c �6 � t D ]B }t j j |j � }t | ||j
� �D |rLt D ]B }t j j |j � }t | ||j
� �D yy)a Attach any subiquity installer logs config.
To support decoupling apport integration from installer config/logs,
we eventually want to either source this function or APPORT_FILES
attribute from subiquity and/or ubuntu-desktop-installer package-hooks
python modules.
N)r �os�path�realpathr �labelr )r, r- r. �apport_filer; s r0 �attach_installer_filesr>