%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/salt/modules/ |
Current File : //usr/lib/python2.7/site-packages/salt/modules/dig.pyc |
� ���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d l Z d d l m Z d d l Z d d l Z e j e � Z d Z d � Z d � Z d d � Z d d � Z e d d � Z d d d � Z e d d � Z d d � Z e Z e Z e Z e Z e Z d S( uq Compendium of generic DNS utilities. The 'dig' command line tool must be installed in order to use this module. i ( t absolute_importt print_functiont unicode_literalsN( t sixu digc C@ s# t j j j d � r t St d f S( u3 Only load module if dig binary is present u diguM The dig execution module cannot be loaded: the dig binary is not in the path.( t saltt utilst patht whicht __virtualname__t False( ( ( s4 /usr/lib/python2.7/site-packages/salt/modules/dig.pyt __virtual__ s c C@ s y | j d d � } Wn t k r* t SXt j j j | d � r� y. d t | d � k oh d k n rq t SWq� t k r� t St k r� t SXn t j j j | d � ry. d t | d � k o� d k n r� t SWqt k r� t St k rt SXn t S( u� Check if address is a valid IP. returns True if valid, otherwise False. CLI Example: .. code-block:: bash salt ns1 dig.check_ip 127.0.0.1 salt ns1 dig.check_ip 1111:2222:3333:4444:5555:6666:7777:8888 u /i i i i i� ( t rsplitt AttributeErrorR R R t networkt is_ipv4t intt Truet ValueErrort IndexErrort is_ipv6( t addr( ( s4 /usr/lib/python2.7/site-packages/salt/modules/dig.pyt check_ip s* & & c C@ s� d d t j | � d g } | d k r@ | j d j | � � n t d | d t �} | d d k r� t j d j | d � � g Sg | d j d � D] } t | � r� | ^ q� S( u� Return the A record for ``host``. Always returns a list. CLI Example: .. code-block:: bash salt ns1 dig.A www.google.com u digu +shortu Au @{0}u cmd.run_allt python_shellu retcodei u? dig returned exit code '{0}'. Returning empty list as fallback.u stdoutu N( R t text_typet Nonet appendt formatt __salt__R t logt warningt splitR ( t hostt nameservert digt cmdt x( ( s4 /usr/lib/python2.7/site-packages/salt/modules/dig.pyt AK s c C@ s� d d t j | � d g } | d k r@ | j d j | � � n t d | d t �} | d d k r� t j d j | d � � g Sg | d j d � D] } t | � r� | ^ q� S( u� Return the AAAA record for ``host``. Always returns a list. CLI Example: .. code-block:: bash salt ns1 dig.AAAA www.google.com u digu +shortu AAAAu @{0}u cmd.run_allR u retcodei u? dig returned exit code '{0}'. Returning empty list as fallback.u stdoutu N( R R R R R R R R R R R ( R R R! R"