�
�Udac @ s� d d l Z d � Z y d d l m Z WnR e k
r} d d l m Z m Z d d l m Z m Z m
Z
m Z d � Z n Xd Z d S(
i����Nc C s t j � d S( s8 Get the current exception.
This code needs to work on Python 2.4 through 3.x, so we cannot use
"except Exception, e:" (SyntaxError on Python 3.x) nor
"except Exception as e:" (SyntaxError on Python 2.4-2.5).
Instead we must use ::
except Exception:
e = get_exception()
i ( t syst exc_info( ( ( sC /usr/lib/python2.7/site-packages/ansible/module_utils/pycompat24.pyt
get_exception s ( t literal_eval( t astt parse( t binary_typet
integer_typest string_typest text_typec sy i d d 6t d 6t d 6� t | t � r? t | d d �} n t | t j � r] | j } n � � f d � � � | � S( s
Safely evaluate an expression node or a string containing a Python
expression. The string or node provided may only consist of the following
Python literal structures: strings, numbers, tuples, lists, dicts, booleans,
and None.
t Nonet Truet Falset modet evalc s t | t j � r; t | j t t t t f t � r; | j St | t j � rc t
t � | j � � St | t j
� r� t t � | j � � St | t j � r� t � f d � | j � D� � St | t j � r� | j � k r� | j Sn t | t j � r� | j � St d � � d S( Nc 3 s- | ]# \ } } � | � � | � f Vq d S( N( ( t .0t kt v( t _convert( sC /usr/lib/python2.7/site-packages/ansible/module_utils/pycompat24.pys <genexpr>O s s malformed string( t
isinstanceR t Constt valueR R t floatt complexR t Tuplet tuplet mapt nodest Listt listt Dictt dictt itemst Namet namet UnarySubt exprt
ValueError( t node( R t _safe_names( sC /usr/lib/python2.7/site-packages/ansible/module_utils/pycompat24.pyR G s 4 N( R
R R R R R R t
ExpressionR&