Current File : //lib/python2.7/site-packages/cloudinit/apport.pyo
�
oB�]c@s�dZy&ddlmZmZmZeZWnek
rEeZnXddddddd	d
ddd
dddddddddddddddddgZ	dZ
d Zd!Zd(d"�Zd(d#�Zd(d$�Zd(d%�Zd&�Zd'�Zd(S()sCloud-init apport interfacei����(tattach_filetattach_root_command_outputstroot_command_outputtAliYuntAltCloudsAmazon - Ec2tAzuretBigstept	Brightboxt
CloudSigmat
CloudStacktDigitalOceantE24CloudsGCE - Google Compute EnginetExoscales
Hetzner Clouds IBM - (aka SoftLayer or BlueMix)tLXDtMAAStNoCloudt
OpenNebulat	OpenStacktOracletOVFs'RbxCloud - (HyperOne, Rootbox, Rubikon)tOpenTelekomCloudtScalewaytSmartOStVMwaretZStacktOthers/var/log/cloud-init.logs/var/log/cloud-init-output.logs%/var/lib/cloud/instance/user-data.txtcCsEt|idd6dd6�tddddg�t|dd	�d
S(sBAttach cloud-init logs and tarfile from 'cloud-init collect-logs'.s-egrep -i "warn|error" /var/log/cloud-init.logscloud-init-log-warningss"cat /var/log/cloud-init-output.logscloud-init-output.log.txts
cloud-initscollect-logss-ts/tmp/cloud-init-logs.tgzslogs.tgzN(RRR(treporttui((s4/usr/lib/python2.7/site-packages/cloudinit/apport.pytattach_cloud_init_logs4s	cCs6d}|r2|j|�r2t|idd6�ndS(s*Optionally attach hardware info from lshw.s�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?tlshwslshw.txtN(tyesnoR(RRtprompt((s4/usr/lib/python2.7/site-packages/cloudinit/apport.pyt
attach_hwinfo?scCs}|ryd}|j|�}|dkr0t�n|ryd}|j|t�}|rit|d|d<qvd|d<qyndS(s&Prompt for cloud details if available.s/Is this machine running in a cloud environment?sOPlease select the cloud vendor or environment in which this instance is runningit	CloudNametNoneN(RR"t
StopIterationtchoicetKNOWN_CLOUD_NAMES(RRRtresponse((s4/usr/lib/python2.7/site-packages/cloudinit/apport.pytattach_cloud_infoIs	cCsY|rUdjt�}|j|�}|dkr9t�n|rUt|td�qUndS(s(Optionally provide user-data if desired.s�Your user-data or cloud-config file 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?s
user_data.txtN(tformattUSER_DATA_FILERR"R#R(RRRR&((s4/usr/lib/python2.7/site-packages/cloudinit/apport.pytattach_user_dataZs		cCs<d|j�kr8|d}d|kr8d|d<q8ndS(s$Add any appropriate tags to the bug.t
JournalErrorssBreaking ordering cyclessystemd-orderingtTagsN(tkeys(Rterrors((s4/usr/lib/python2.7/site-packages/cloudinit/apport.pytadd_bug_tagsis
cCsWtstd��nt||�t||�t||�t||�t|�tS(s-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).
    s;No apport imports discovered. Apport functionality disabled(t
has_apporttRuntimeErrorRR R'R*R/tTrue(RR((s4/usr/lib/python2.7/site-packages/cloudinit/apport.pytadd_infoqs




N(t__doc__tapport.hookutilsRRRR2R0tImportErrortFalseR%t
CLOUDINIT_LOGtCLOUDINIT_OUTPUT_LOGR)R"RR R'R*R/R3(((s4/usr/lib/python2.7/site-packages/cloudinit/apport.pyt<module>sT