%PDF- %PDF-
Direktori : /lib/python2.7/site-packages/salt/modules/ |
Current File : //lib/python2.7/site-packages/salt/modules/etcd_mod.pyo |
� ���^c @@ s d Z d d l m Z m Z m Z d d l Z y d d l Z e Z Wn e k r] e Z n Xd Z e j e � Z i d d 6d d 6d d 6d d 6Z d � Z e d d � Z d d e d � Z d d d � Z e d d d d � Z d d d � Z e d d � Z d d d � Z d S( u� Execution module to work with etcd :depends: - python-etcd Configuration ------------- To work with an etcd server you must configure an etcd profile. The etcd config can be set in either the Salt Minion configuration file or in pillar: .. code-block:: yaml my_etd_config: etcd.host: 127.0.0.1 etcd.port: 4001 It is technically possible to configure etcd without using a profile, but this is not considered to be a best practice, especially when multiple etcd servers or clusters are available. .. code-block:: yaml etcd.host: 127.0.0.1 etcd.port: 4001 .. note:: The etcd configuration can also be set in the Salt Master config file, but in order to use any etcd configurations defined in the Salt Master config, the :conf_master:`pillar_opts` must be set to ``True``. Be aware that setting ``pillar_opts`` to ``True`` has security implications as this makes all master configuration settings available in all minion's pillars. i ( t absolute_importt print_functiont unicode_literalsNu etcdu getu get_u setu set_u rmu rm_u lsu ls_c C@ s t r t St d f S( u1 Only return if python-etcd is installed uR The etcd_mod execution module cannot be loaded: python etcd library not available.( t HAS_LIBSt __virtualname__t False( ( ( s9 /usr/lib/python2.7/site-packages/salt/modules/etcd_mod.pyt __virtual__B s c K@ s@ t d t | | � } | r) | j | � S| j | d | �Sd S( u� .. versionadded:: 2014.7.0 Get a value from etcd, by direct path. Returns None on failure. CLI Examples: .. code-block:: bash salt myminion etcd.get /path/to/key salt myminion etcd.get /path/to/key profile=my_etcd_config salt myminion etcd.get /path/to/key recurse=True profile=my_etcd_config salt myminion etcd.get /path/to/key host=127.0.0.1 port=2379 u etcd_util.get_connt recurseN( t __utils__t __opts__t treet get( t keyR t profilet kwargst client( ( s9 /usr/lib/python2.7/site-packages/salt/modules/etcd_mod.pyt get_L s c K@ s2 t d t | | � } | j | | d | d | �S( u .. versionadded:: 2014.7.0 Set a key in etcd by direct path. Optionally, create a directory or set a TTL on the key. Returns None on failure. CLI Example: .. code-block:: bash salt myminion etcd.set /path/to/key value salt myminion etcd.set /path/to/key value profile=my_etcd_config salt myminion etcd.set /path/to/key value host=127.0.0.1 port=2379 salt myminion etcd.set /path/to/dir '' directory=True salt myminion etcd.set /path/to/key value ttl=5 u etcd_util.get_connt ttlt directory( R R t set( R t valueR R R R R ( ( s9 /usr/lib/python2.7/site-packages/salt/modules/etcd_mod.pyt set_b s u c K@ s&