Viewing File: /usr/lib/python2.7/site-packages/cloudinit/config/cc_debug.pyo
ó
oBú]c @ s€ d Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z e d g ƒ Z d „ Z
d „ Z d
„ Z d S( 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( t StringIO( t
type_utils( t util( t safeyamlt log_cfgsc C su t ƒ } | j d d ƒ | j d ƒ | j | j d d ƒ ƒ | j d ƒ | j d d ƒ | j d ƒ | j ƒ S( Nt -iP s
t ( R t writet centert getvalue( t textt header( ( s= /usr/lib/python2.7/site-packages/cloudinit/config/cc_debug.pyt _make_header) s
c C s% t j | d t d t ƒ} | j ƒ S( Nt explicit_startt explicit_end( R t dumpst Falset rstrip( t objR
( ( s= /usr/lib/python2.7/site-packages/cloudinit/config/cc_debug.pyt _dumps4 s c C sx t j | d d t ƒ} | r1 | d } t } n t j | d ƒ } | s] | j d | ƒ d St j | ƒ } x t D] } | j | d ƒ qs Wt | ƒ } x0 | D]( } | j
d ƒ r | j | d ƒ q q Wt ƒ }
|
j t
d ƒ ƒ |
j t | ƒ ƒ |
j d
ƒ |
j t
d ƒ ƒ |
j t | j j ƒ ƒ |
j d
ƒ |
j t
d ƒ ƒ |
j d
t j | j ƒ ƒ |
j d t j | j ƒ ƒ |
j d | j t ƒ ƒ |
j d | j ƒ ƒ |
j d | j ƒ ƒ |
j d | j ƒ |
j ƒ } g } x+ | j ƒ D] }
d |
}
| j |
ƒ q W| rRt j | d j | ƒ d d ƒ n"