%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/core18/current/usr/lib/python3/dist-packages/cloudinit/__pycache__/
Upload File :
Create Path :
Current File : //snap/core18/current/usr/lib/python3/dist-packages/cloudinit/__pycache__/apport.cpython-36.pyc

3

�Ad��*@sdZddlZddlmZddlmZmZy ddlmZm	Z	m
Z
mZdZWne
k
r`dZYnXdd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)g"Zd*Zd+Zed,�d-d.�Zd=d/d0�Zd>d1d2�Zd?d3d4�Zd@d5d6�ZdAd7d8�Zd9d:�Zd;d<�ZdS)BzCloud-init apport interface�N)�read_cfg_paths)�INSTALLER_APPORT_FILES� INSTALLER_APPORT_SENSITIVE_FILES)�attach_file�attach_file_if_exists�attach_root_command_outputs�root_command_outputTFZAliYunZAltCloudzAmazon - Ec2ZAzureZBigstepZ	BrightboxZ
CloudSigmaZ
CloudStackZDigitalOceanZE24CloudzGCE - Google Compute EnginezHuawei CloudZExoscalez
Hetzner CloudZNWCSz IBM - (aka SoftLayer or BlueMix)ZLXDZMAASZNoCloudZ
OpenNebulaZ	OpenStackZOracleZOVFz'RbxCloud - (HyperOne, Rootbox, Rubikon)ZOpenTelekomCloudzSAP Converged CloudZScalewayZSmartOSZUpCloudZVMwareZVultrZZStackZOutscaleZOtherz/var/log/cloud-init.logz/var/log/cloud-init-output.log)�returncCst�}|jd�S)NZuserdata_raw)rZ
get_ipath_cur)�paths�r�2/usr/lib/python3/dist-packages/cloudinit/apport.py�_get_user_data_fileFsr
cCs0t|ddd��tddddg�t|dd�d	S)
zBAttach cloud-init logs and tarfile from 'cloud-init collect-logs'.z-egrep -i "warn|error" /var/log/cloud-init.logz"cat /var/log/cloud-init-output.log)zcloud-init-log-warningszcloud-init-output.log.txtz
cloud-initzcollect-logsz-tz/tmp/cloud-init-logs.tgzzlogs.tgzN)rrr)�report�uirrr�attach_cloud_init_logsKs
rcCs$d}|r |j|�r t|ddi�dS)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.txtZlshwN)�yesnor)rr�promptrrr�
attach_hwinfo\srcCsT|rPd}|j|�}|dkrt�|rPd}|j|t�}|rHt|d|d<nd|d<dS)z&Prompt for cloud details if available.z/Is this machine running in a cloud environment?NzOPlease select the cloud vendor or environment in which this instance is runningrZ	CloudName�None)r�
StopIterationZchoice�KNOWN_CLOUD_NAMES)rrr�responserrr�attach_cloud_infogs
rcCs.x(tD] }tjj|j�}t|||j�qWdS)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�label)rr�apport_filerrrr�attach_installer_fileszs
rcCst|rpt�}dj|�}|j|�}|dkr*t�|rptjj|�}t||d�x(tD] }tjj|j�}t	|||j
�qLWdS)z(Optionally provide user-data if desired.z�Your user-data, cloud-config or autoinstall files can optionally  be provided from {0} and could be useful to developers when addressing this bug. Do you wish to attach user-data to this bug?Nz
user_data.txt)r
�formatrrrrrrrrr)rrZuser_data_filerrrrrrr�attach_user_data�s

r cCs�g}|jd�r|jd�|jd�r,|jd�d|j�krR|d}d|krR|jd�|jd�rf|jd	�|r�|jd
d�|d
r�|d
d7<|d
dj|�7<d
S)z$Add any appropriate tags to the bug.ZCurtinErrorZcurtinZSubiquityLogZ	subiquityZ
JournalErrorszBreaking ordering cyclezsystemd-orderingZUdiLogzubuntu-desktop-installerZTags�� N)�get�append�keys�
setdefault�join)rZnew_tags�errorsrrr�add_bug_tags�s 






r)cCsJtstd��t||�t||�t||�t||�t||�t|�dS)a-This is an entry point to run cloud-init's apport functionality.

    Distros which want apport support will have a cloud-init package-hook at
    /usr/share/apport/package-hooks/cloud-init.py which defines an add_info
    function and returns the result of cloudinit.apport.add_info(report, ui).
    z;No apport imports discovered. Apport functionality disabledT)�
has_apport�RuntimeErrorrrrr rr))rrrrr�add_info�s




r,)N)N)N)N)N)�__doc__rZcloudinit.cmd.develrZcloudinit.cmd.devel.logsrrZapport.hookutilsrrrrr*�ImportErrorrZ
CLOUDINIT_LOGZCLOUDINIT_OUTPUT_LOG�strr
rrrrr r)r,rrrr�<module>sh







Zerion Mini Shell 1.0