%PDF- %PDF-
Direktori : /proc/thread-self/root/usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/ |
Current File : //proc/thread-self/root/usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/grains.pyc |
� ���^c @@ sG d Z d d l 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 d l Z d d l m Z d d l m Z d d l m Z i Z d � Z d � Z d � Z d � Z i e d 6e d 6e d 6e d 6e d 6e d 6e d 6Z d e e d � Z d � Z e d � Z d � Z d � Z d d d d d � Z d S( s+ Return/control aspects of the grains data i ( t absolute_importt print_functionN( t DEFAULT_TARGET_DELIM( t SaltException( t sixc C@ sA t | � } t t j | d � � } d j | | d | | � S( s4 Replaces the last 1/4 of a string with X's g �?s {0}{1}t X( t lent intt matht floort format( t instrt lengtht index( ( sB /usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/grains.pyt _serial_sanitizer s c C@ s d S( Ns MINION.DOMAINNAME( ( t x( ( sB /usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/grains.pyt <lambda># s c C@ s d S( Nt MINION( ( R ( ( sB /usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/grains.pyR $ s c C@ s d S( Nt DOMAINNAME( ( R ( ( sB /usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/grains.pyR % s t serialnumbert domaint fqdnt idt hostt localhostt nodenamet c C@ sU | t k r t } n$ t j j j t j j j t � � } t j j j t | | | � S( s2 Attempt to retrieve the named value from grains, if the named value is not available return the passed default. The default return is an empty string. The value can also represent a value in a nested dict using a ":" delimiter for the dict. This means that if a dict in grains looks like this:: {'pkg': {'apache': 'httpd'}} To retrieve the value associated with the apache key in the pkg dict this key can be passed:: pkg:apache CLI Example: .. code-block:: bash salt '*' grains.get pkg:apache ( t Truet __grains__t saltt utilst jsont loadst dumpst datat traverse_dict_and_list( t keyt defaultt delimitert orderedt grains( ( sB /usr/lib/python2.7/site-packages/salt/client/ssh/wrapper/grains.pyt get5 s $c C@ s# t j j j t | t � r t St S( sl Determine whether a named value exists in the grains dictionary. Given a grains dictionary that contains the following structure:: {'pkg': {'apache': 'httpd'}} One would determine if the apache key in the pkg dict exists by:: pkg:apache CLI Example: .. code-block:: bash salt '*' grains.has_value pkg:apache ( R R R"