Current File : //lib/python2.7/site-packages/cloudinit/config/cc_debug.pyo
�
oB�]c@s�dZddlZddlmZddlmZddlmZddlmZedg�Z	d�Z
d	�Zd
�ZdS(sQ
Debug
-----
**Summary:** helper to debug cloud-init *internal* datastructures.

This module will enable for outputting various internal information that
cloud-init sources provide to either a file or to the output console/log
location that this cloud-init has been configured with when running.

.. note::
    Log configurations are not output.

**Internal name:** ``cc_debug``

**Module frequency:** per instance

**Supported distros:** all

**Config keys**::

    debug:
       verbose: true/false (defaulting to true)
       output: (location to write output, defaulting to console + log)
i����N(tStringIO(t
type_utils(tutil(tsafeyamltlog_cfgscCsut�}|jdd�|jd�|j|jdd��|jd�|jdd�|jd�|j�S(Nt-iPs
t (Rtwritetcentertgetvalue(ttexttheader((s=/usr/lib/python2.7/site-packages/cloudinit/config/cc_debug.pyt_make_header)s	


cCs%tj|dtdt�}|j�S(Ntexplicit_starttexplicit_end(RtdumpstFalsetrstrip(tobjR
((s=/usr/lib/python2.7/site-packages/cloudinit/config/cc_debug.pyt_dumps4scCsxtj|ddt�}|r1|d}t}ntj|d�}|s]|jd|�dStj|�}xtD]}|j|d�qsWt	|�}	x0|	D](}|j
d�r�|j|d�q�q�Wt�}
|
jt
d	��|
jt|��|
jd
�|
jt
d��|
jt|jj��|
jd
�|
jt
d��|
jd
tj|j��|
jdtj|j��|
jd|jt��|
jd|j��|
jd|j��|
jd|j�|
j�}g}x+|j�D]}
d|
}
|j|
�q	W|rRtj|dj|�dd�n"tjdj|�dtdt�dS(s'Handler method activated by cloud-init.tdebugtverbosetdefaultitoutputs3Skipping module named %s, verbose printing disabledNt_tConfigs
tMetaDatatMiscsDatasource: %s
sDistro: %s
s
Hostname: %s
sInstance ID: %s
sLocale: %s
sLaunch IDX: %s
sci-info: %s
ti�twtconsoletstderr(sdebugsverbose(sdebugsoutput(Rtget_cfg_by_pathtTrueRtcopytdeepcopyt	SKIP_KEYStpoptNonetlistt
startswithRRRRt
datasourcetmetadataRtobj_nametdistrotget_hostnametget_instance_idt
get_localetlaunch_indexR	t
splitlinestappendt
write_filetjoint	multi_logR(tnametcfgtcloudtlogtargsRtout_filetdump_cfgtktall_keystto_printtcontentstcontent_to_filetline((s=/usr/lib/python2.7/site-packages/cloudinit/config/cc_debug.pythandle9sN
		

	

	
"(
t__doc__R"tsixRt	cloudinitRRRt	frozensetR$RRRC(((s=/usr/lib/python2.7/site-packages/cloudinit/config/cc_debug.pyt<module>s