%PDF- %PDF-
Direktori : /lib/python2.7/site-packages/salt/grains/ |
Current File : //lib/python2.7/site-packages/salt/grains/fx2.pyo |
� ���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l Z d d l Z d g Z d Z e j e � Z i Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d S( u Generate baseline proxy minion grains for Dell FX2 chassis. The challenge is that most of Salt isn't bootstrapped yet, so we need to repeat a bunch of things that would normally happen in proxy/fx2.py--just enough to get data from the chassis to include in grains. i ( t absolute_importt print_functiont unicode_literalsNu fx2c C@ s? t j j j � r; d t k r; t d j d � d k r; t St S( Nu proxyu proxytypeu fx2( t saltt utilst platformt is_proxyt __opts__t gett __virtualname__t False( ( ( s3 /usr/lib/python2.7/site-packages/salt/grains/fx2.pyt __virtual__ s 7c C@ s5 g } | j t d j d d � � d t j d � k rU | j t d j d � � n x� | D]� } x� t d d D]� } t j j j d t d d d | d | � } yB | j d d � d k r� | t d d <| t d d <| | f SWqq t k r| t d d <| t d d <| | f SXqq Wq\ Wt j d � d S( u\ Cycle through all the possible credentials and return the first one that works u proxyu admin_usernameu rootu fallback_admin_usernameu passwordst hostu hostt admin_usernamet admin_passwordu retcodeu admin_passworduJ grains fx2.find_credentials found no valid credentials, using Dell defaultu calvinN( u rootu calvin( t appendt __pillar__R R t modulest dracrt get_chassis_namet NoneR t AttributeErrort loggert debug( t usernamest usert pwdt r( ( s3 /usr/lib/python2.7/site-packages/salt/grains/fx2.pyt _find_credentials s* c C@ s� t � \ } } t j j j d t d d d | d | � } | j d d � d k r\ | } n i } | j t j j j d t d d d | d | � � | S( u0 Get the grains from the proxied device R u proxyu hostR R u retcodei ( R R R R t system_infoR R t updatet inventory( t usernamet passwordR t GRAINS_CACHE( ( s3 /usr/lib/python2.7/site-packages/salt/grains/fx2.pyt _grainsA s # c C@ s t � S( N( R# ( ( ( s3 /usr/lib/python2.7/site-packages/salt/grains/fx2.pyt fx2V s c C@ s i d d 6S( Nu proxyu kernel( ( ( ( s3 /usr/lib/python2.7/site-packages/salt/grains/fx2.pyt kernelZ s c C@ sZ t s t j t � � n y! i t j d � j d � d 6SWn t k rU i d d 6SXd S( Nu Chassis Informationu Chassis Locationu locationu Unknown( R"