%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/salt/modules/ |
Current File : //usr/lib/python2.7/site-packages/salt/modules/data.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 Z d d l Z d d l Z d d l m Z e j e � Z d � Z d � Z d � Z d � Z d � Z d d � Z d d � Z d � Z d � Z d � Z d � Z d S( ub Manage a local persistent data structure that can hold any arbitrary data specific to the minion i ( t absolute_importt print_functiont unicode_literalsN( t sixc C@ sB y$ t j t j j t d d � � Wn t t f k r= n Xt S( u� Clear out all of the data in the minion datastore, this function is destructive! CLI Example: .. code-block:: bash salt '*' data.clear u cachediru datastore( t ost removet patht joint __opts__t IOErrort OSErrort True( ( ( s5 /usr/lib/python2.7/site-packages/salt/modules/data.pyt clear s $c C@ s� t j j t � } yQ t j j t d d � } t j j j | d � � } | j | j � � SWd QXWn t t t f k r� i SXd S( u� Return all of the data in the minion datastore CLI Example: .. code-block:: bash salt '*' data.load u cachediru datastoreu rbN( t saltt payloadt SerialR R R R t utilst filest fopent loadst readR R t NameError( t serialt datastore_patht rfh( ( s5 /usr/lib/python2.7/site-packages/salt/modules/data.pyt load) s c C@ s� t | t � s@ t t j | � t � r9 t j | � } q@ t Sn yd t j j t d d � } t j j j | d � �) } t j j t � } | j | | � Wd QXt SWn t t t f k r� t SXd S( u� Replace the entire datastore with a passed data structure CLI Example: .. code-block:: bash salt '*' data.dump '{'eggs': 'spam'}' u cachediru datastoreu w+bN( t isinstancet dictt astt literal_evalt FalseR R R R R R R R R R t dumpR R R R ( t new_dataR t fn_R ( ( s5 /usr/lib/python2.7/site-packages/salt/modules/data.pyR = s c C@ s! t � } | | | <t | � t S( u� Update a key with a value in the minion datastore CLI Example: .. code-block:: bash salt '*' data.update <key> <value> ( R R R ( t keyt valuet store( ( s5 /usr/lib/python2.7/site-packages/salt/modules/data.pyt updateY s c C@ sE t � } | | k r t S| | | k r- t S| | | <t | � t S( u� Check and set a value in the minion datastore CLI Example: .. code-block:: bash salt '*' data.cas <key> <value> <old_value> ( R R R R ( R"