HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/1991111/root/usr/lib/python3/dist-packages/cloudinit/__pycache__/
Upload File :
Current File : //proc/1991111/root/usr/lib/python3/dist-packages/cloudinit/__pycache__/apport.cpython-311.pyc
�

܍~c����dZddlZddlmZddlmZmZ	ddlmZm	Z	m
Z
mZdZn
#e
$rdZYnwxYwgd�Zd	Zd
Zdefd�Zdd
�Zdd�Zdd�Zdd�Zdd�Zd�Zd�ZdS)zCloud-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_outputTF)"�AliYun�AltCloudzAmazon - Ec2�Azure�Bigstep�	Brightbox�
CloudSigma�
CloudStack�DigitalOcean�E24CloudzGCE - Google Compute EnginezHuawei Cloud�Exoscalez
Hetzner Cloud�NWCSz IBM - (aka SoftLayer or BlueMix)�LXD�MAAS�NoCloud�
OpenNebula�	OpenStack�Oracle�OVFz'RbxCloud - (HyperOne, Rootbox, Rubikon)�OpenTelekomCloudzSAP Converged Cloud�Scaleway�SmartOS�UpCloud�VMware�Vultr�ZStack�Outscale�Otherz/var/log/cloud-init.logz/var/log/cloud-init-output.log�returnc�H�t��}|�d��S)N�userdata_raw)r�
get_ipath_cur)�pathss �2/usr/lib/python3/dist-packages/cloudinit/apport.py�_get_user_data_filer+Fs!�����E����~�.�.�.�c�p�t|ddd���tgd���t|dd��dS)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.txt)z
cloud-initzcollect-logsz-t�/tmp/cloud-init-logs.tgzr.zlogs.tgzN)rr	r��report�uis  r*�attach_cloud_init_logsr2Ksb����@�)M�		
�	
�����H�H�H������2�J�?�?�?�?�?r,c�d�d}|r)|�|��rt|ddi��dSdSdS)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)r0r1�prompts   r*�
attach_hwinfor7\s^��	0��

�B�b�h�h�v���B�#�F�Z��,@�A�A�A�A�A�B�B�B�Br,c���|r`d}|�|��}|�t�|r@d}|�|t��}|rt|d|d<dSd|d<dSdSdS)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 runningr�	CloudName�None)r5�
StopIteration�choice�KNOWN_CLOUD_NAMES)r0r1r6�responses    r*�attach_cloud_infor?gs���	�-�B���8�8�F�#�#�������		-�,�
��y�y��):�;�;�H��
-�&7����&D��{�#�#�#�&,��{�#�#�#�-�-�
		-�		-r,c��tD]<}tj�|j��}t	|||j���=dS)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)r0r1�apport_filerCs    r*�attach_installer_filesrFzsQ��.�C�C���7�#�#�K�$4�5�5���f�h��0A�B�B�B�B�C�Cr,c��|r�t��}d�|��}|�|��}|�t�|rvtj�|��}t||d��tD]@}tj�|j��}t|||j
���=dSdSdS)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+�formatr5r;rArBrCrrrrD)r0r1�user_data_filer6r>rCrEs       r*�attach_user_datarJ�s���	�K�,�.�.��
��F�>�*�*�		��8�8�F�#�#�������	K��w�'�'��7�7�H����/�:�:�:�?�
K�
K���7�+�+�K�,<�=�=��%�f�h��8I�J�J�J�J�!K�K�	K�	K�
K�
Kr,c��g}|�d��r|�d��|�d��r|�d��d|���vr!|d}d|vr|�d��|�d��r|�d	��|rS|�d
d��|d
r|d
xxdz
cc<|d
xxd�|��z
cc<d
Sd
S)z$Add any appropriate tags to the bug.�CurtinError�curtin�SubiquityLog�	subiquity�
JournalErrorszBreaking ordering cyclezsystemd-ordering�UdiLogzubuntu-desktop-installer�Tags�� N)�get�append�keys�
setdefault�join)r0�new_tags�errorss   r*�add_bug_tagsr\�s%���H�
�z�z�-� � �"�����!�!�!�
�z�z�.�!�!�%�����$�$�$��&�+�+�-�-�'�'���(��$��.�.��O�O�.�/�/�/�
�z�z�(���4����2�3�3�3��-����&�"�%�%�%��&�>�	"��6�N�N�N�c�!�N�N�N��v����#�(�(�8�,�,�,������	-�-r,c���tstd���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�RuntimeErrorr2r7r?rJrFr\r/s  r*�add_infor`�s����
��I�
�
�	
��6�2�&�&�&��&�"�����f�b�!�!�!��V�R� � � ��6�2�&�&�&�������4r,)N)�__doc__rA�cloudinit.cmd.develr�cloudinit.cmd.devel.logsrr�apport.hookutilsrrrr	r^�ImportErrorr=�
CLOUDINIT_LOG�CLOUDINIT_OUTPUT_LOG�strr+r2r7r?rFrJr\r`�r,r*�<module>rjs���
"�!�	�	�	�	�.�.�.�.�.�.���������

��������������J�J�������J�J�J�����#�#�#��L*�
�7��/�S�/�/�/�/�
@�@�@�@�"B�B�B�B�-�-�-�-�&
C�
C�
C�
C�K�K�K�K�*-�-�-�(����s�%�/�/