Module Expr Str ImportFrom alias Import alias ImportFrom alias TryExcept body Import alias ImportFrom alias alias Assign NameStore NameLoad handlers ExceptHandler type NameLoad body Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad ClassDef bases NameLoad body Expr Str Pass decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Dict Assign NameStore Call AttributeLoad NameLoad attr Str Dict Assign NameStore Dict Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Dict orelse Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Dict If BoolOpAnd NameLoad NameLoad body Assign NameStore Dict Str Str Call NameLoad NameLoad Call NameLoad NameLoad If NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad orelse Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad Num NameLoad body Assign NameStore Dict Str Str Str Str Str NameLoad NameLoad NameLoad Num NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad handlers ExceptHandler type NameLoad body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str Return NameLoad ExceptHandler type NameLoad body Return Dict If BoolOpAnd NameLoad Call NameLoad NameLoad Str body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call NameLoad NameLoad Str Assign SubscriptStore NameLoad Index Str Call NameLoad NameLoad Str Return NameLoad ExceptHandler type TupleLoad AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Return Dict ExceptHandler type NameLoad body Return Dict If NameLoad body Assign SubscriptStore NameLoad Index Str Call NameLoad NameLoad Str NameLoad Assign SubscriptStore NameLoad Index Str Call NameLoad NameLoad Str NameLoad Assign SubscriptStore NameLoad Index Str Call NameLoad NameLoad Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str Call NameLoad NameLoad Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Return NameLoad ExceptHandler type AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Return NameLoad ExceptHandler type NameLoad body Return NameLoad Return Call NameLoad NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad body TryExcept body If NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad keyword NameLoad keyword NameLoad handlers ExceptHandler type TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr name NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Raise ExceptHandler type NameLoad body If NameLoad body Expr Call AttributeLoad NameLoad attr Str Raise Call NameLoad Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr Str Raise Call AttributeLoad NameLoad attr Str ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Str Raise Call AttributeLoad NameLoad attr Str ExceptHandler type AttributeLoad NameLoad attr name NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Raise ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Str Raise ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Raise Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str body If CompareEq Call NameLoad Call AttributeLoad NameLoad attr Num body Return Dict NameLoad Dict Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Dict For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Str If NameLoad body Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad orelse Assign NameStore Call AttributeLoad Str attr NameLoad If Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad orelse Assign SubscriptStore NameLoad Index NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str body If UnaryOpNot Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Dict For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign NameStore NameLoad If Call NameLoad NameLoad NameLoad body Assign NameStore NameLoad Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Return Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body If NameLoad body Assign NameStore NameLoad TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad keyword NameLoad keyword NameLoad handlers ExceptHandler type TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Return NameLoad ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Return NameLoad ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Raise If NameLoad body Return Call NameLoad NameLoad Str orelse Return Call NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Dict TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type TupleLoad AttributeLoad NameLoad attr NameLoad body Return Dict ExceptHandler type AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Return NameLoad For NameStore AttributeLoad NameLoad attr body If CompareIs AttributeLoad NameLoad attr NameLoad body If CompareEq AttributeLoad NameLoad attr NameLoad body Continue Assign NameStore Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index NameLoad Dict orelse Assign SubscriptStore NameLoad Index AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return Dict NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body TryExcept body If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad body Return NameLoad orelse Return NameLoad handlers ExceptHandler type TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Return NameLoad ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Return NameLoad ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Raise decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Dict TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type TupleLoad AttributeLoad NameLoad attr NameLoad body Return NameLoad ExceptHandler type AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Return NameLoad For NameStore AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad Call NameLoad AttributeLoad NameLoad attr attr Str If CompareIs AttributeLoad NameLoad attr NameLoad body If CompareEq AttributeLoad NameLoad attr NameLoad body Continue Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index Num Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index Num AttributeLoad NameLoad attr Return NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad decorator_list
N/A N/A 
Utilities for working with etcd

.. versionadded:: 2014.7.0

:depends:  - python-etcd

This library sets up a client object for etcd, using the configuration passed
into the client() function. Normally, this is __opts__. Optionally, a profile
may be passed in. The following configurations are both valid:

.. code-block:: yaml

    # No profile name
    etcd.host: 127.0.0.1
    etcd.port: 4001
    etcd.username: larry  # Optional; requires etcd.password to be set
    etcd.password: 123pass  # Optional; requires etcd.username to be set

    # One or more profiles defined
    my_etcd_config:
      etcd.host: 127.0.0.1
      etcd.port: 4001
      etcd.username: larry  # Optional; requires etcd.password to be set
      etcd.password: 123pass  # Optional; requires etcd.username to be set

Once configured, the client() function is passed a set of opts, and optionally,
the name of a profile to be used.

.. code-block:: python

    import salt.utils.etcd_utils
    client = salt.utils.etcd_utils.client(__opts__, profile='my_etcd_config')

You may also use the newer syntax and bypass the generator function.

.. code-block:: python

    import salt.utils.etcd_utils
    client = salt.utils.etcd_utils.EtcdClient(__opts__, profile='my_etcd_config')

It should be noted that some usages of etcd require a profile to be specified,
rather than top-level configurations. This being the case, it is better to
always use a named configuration profile, as shown above.
 __future__ absolute_import N/A logging salt.exceptions CommandExecutionError N/A N/A N/A etcd urllib3.exceptions ReadTimeoutError MaxRetryError N/A HAS_LIBS True N/A N/A N/A ImportError N/A N/A HAS_LIBS False N/A log N/A N/A logging getLogger __name__ EtcdUtilWatchTimeout N/A Exception N/A N/A 
    A watch timed out without returning a result
     N/A N/A EtcdClient N/A object N/A __init__ N/A N/A self opts profile N/A None N/A N/A opts_pillar N/A N/A opts get pillar N/A N/A opts_master N/A N/A opts_pillar get master N/A N/A opts_merged N/A N/A N/A N/A opts_merged update opts_master N/A N/A N/A opts_merged update opts_pillar N/A N/A N/A opts_merged update opts N/A profile N/A N/A N/A self conf N/A N/A opts_merged get profile N/A N/A N/A N/A self conf opts_merged N/A host N/A N/A N/A self conf get etcd.host 127.0.0.1 N/A port N/A N/A N/A self conf get etcd.port 4001 N/A username N/A N/A N/A self conf get etcd.username N/A password N/A N/A N/A self conf get etcd.password N/A auth N/A N/A N/A username password N/A N/A auth N/A username password N/A str username N/A str password N/A HAS_LIBS N/A N/A N/A self client N/A N/A etcd Client host port auth N/A N/A N/A CommandExecutionError (unable to import etcd, module most likely not installed) N/A watch N/A N/A self key recurse timeout index N/A False 0 None N/A N/A ret N/A key value changed mIndex dir key None False 0 False N/A N/A N/A result N/A N/A self read key recursive recurse wait True timeout timeout waitIndex index N/A N/A N/A EtcdUtilWatchTimeout N/A N/A N/A N/A result N/A N/A self read key N/A N/A N/A N/A etcd EtcdKeyNotFound N/A N/A N/A N/A log debug etcd: key was not created while watching N/A ret N/A N/A ValueError N/A N/A N/A N/A N/A result N/A getattr result dir N/A N/A N/A ret N/A dir True N/A N/A ret N/A value N/A getattr result value N/A N/A ret N/A mIndex N/A getattr result modifiedIndex N/A ret N/A N/A N/A N/A etcd EtcdConnectionFailed MaxRetryError N/A N/A N/A N/A log error N/A N/A etcd: failed to perform 'watch' operation on key {0} due to connection error format key N/A N/A N/A N/A ValueError N/A N/A N/A N/A recurse N/A N/A N/A ret N/A key N/A getattr result key None N/A N/A ret N/A value N/A getattr result value None N/A N/A ret N/A dir N/A getattr result dir None N/A N/A ret N/A changed True N/A N/A ret N/A mIndex N/A getattr result modifiedIndex N/A ret N/A get N/A N/A self key recurse N/A False N/A N/A N/A N/A result N/A N/A self read key recursive recurse N/A N/A N/A N/A etcd EtcdKeyNotFound N/A N/A None N/A N/A N/A etcd EtcdConnectionFailed N/A N/A N/A N/A log error N/A N/A etcd: failed to perform 'get' operation on key {0} due to connection error format key N/A None N/A N/A ValueError N/A N/A None N/A N/A getattr result value None N/A read N/A N/A self key recursive wait timeout waitIndex N/A False False None None N/A N/A N/A N/A waitIndex N/A N/A result N/A N/A N/A self client read key recursive recursive wait wait timeout timeout waitIndex waitIndex N/A N/A result N/A N/A N/A self client read key recursive recursive wait wait timeout timeout N/A N/A N/A N/A N/A etcd EtcdConnectionFailed N/A etcd EtcdKeyNotFound N/A err N/A N/A N/A N/A log error N/A N/A etcd: {0} format err N/A N/A N/A ReadTimeoutError N/A N/A wait N/A N/A N/A N/A log debug etcd: Timed out while executing a wait N/A N/A EtcdUtilWatchTimeout N/A N/A Watch on {0} timed out format key N/A N/A N/A log error etcd: Timed out N/A N/A N/A etcd EtcdConnectionFailed Connection failed N/A N/A MaxRetryError N/A err N/A N/A N/A N/A log error etcd: Could not connect N/A N/A N/A etcd EtcdConnectionFailed Could not connect to etcd server N/A N/A N/A etcd EtcdException N/A err N/A N/A N/A N/A log error N/A N/A etcd: {0} format err N/A N/A N/A ValueError N/A N/A N/A N/A log error etcd: error. python-etcd does not fully support python 2.6, no error information available N/A N/A N/A Exception N/A err N/A N/A N/A N/A log error N/A N/A etcd: uncaught exception {0} format err N/A N/A result N/A _flatten N/A N/A self data path N/A N/A N/A N/A N/A len N/A N/A data keys 0 N/A N/A N/A path N/A N/A path N/A N/A path strip / N/A flat N/A N/A N/A k v N/A N/A data iteritems N/A N/A k N/A N/A k strip / N/A path N/A N/A p N/A N/A /{0}/{1} format path k N/A N/A p N/A N/A /{0} format k N/A N/A isinstance v dict N/A N/A ret N/A N/A self _flatten v p N/A N/A N/A flat update ret N/A N/A N/A flat N/A p v N/A flat N/A update N/A N/A self fields path N/A N/A N/A N/A N/A isinstance fields dict N/A N/A N/A N/A log error etcd.update: fields is not type dict N/A None N/A fields N/A N/A self _flatten fields path N/A keys N/A N/A N/A k v N/A N/A fields iteritems N/A N/A is_dir False N/A N/A isinstance v dict N/A N/A is_dir True N/A N/A keys N/A k N/A N/A self write k v directory is_dir N/A keys N/A set N/A N/A self key value ttl directory N/A None False N/A N/A N/A N/A self write key value ttl ttl directory directory N/A write N/A N/A self key value ttl directory N/A None False N/A N/A directory N/A N/A value None N/A N/A N/A result N/A N/A N/A self client write key value ttl ttl dir directory N/A N/A N/A N/A N/A etcd EtcdNotFile N/A etcd EtcdNotDir N/A etcd EtcdRootReadOnly ValueError N/A err N/A N/A N/A N/A log error N/A N/A etcd: {0} format err N/A None N/A N/A MaxRetryError N/A err N/A N/A N/A N/A log error N/A N/A etcd: Could not connect to etcd server: {0} format err N/A None N/A N/A Exception N/A err N/A N/A N/A N/A log error N/A N/A etcd: uncaught exception {0} format err N/A N/A directory N/A N/A N/A getattr result dir N/A N/A N/A getattr result value N/A ls N/A N/A self path N/A N/A N/A ret N/A N/A N/A N/A items N/A N/A self read path N/A N/A N/A N/A N/A etcd EtcdKeyNotFound ValueError N/A N/A N/A N/A N/A N/A etcd EtcdConnectionFailed N/A N/A N/A N/A log error N/A N/A etcd: failed to perform 'ls' operation on path {0} due to connection error format path N/A None N/A item N/A items children N/A N/A N/A N/A item dir True N/A N/A N/A N/A item key path N/A N/A N/A dir_name N/A N/A {0}/ format N/A item key N/A N/A ret N/A dir_name N/A N/A N/A N/A ret N/A N/A item key N/A item value N/A N/A path ret N/A rm N/A N/A self key recurse N/A False N/A N/A N/A N/A self delete key recurse N/A delete N/A N/A self key recursive N/A False N/A N/A N/A N/A N/A N/A N/A self client delete key recursive recursive N/A N/A True N/A N/A False N/A N/A N/A N/A N/A etcd EtcdNotFile N/A etcd EtcdRootReadOnly N/A etcd EtcdDirNotEmpty N/A etcd EtcdKeyNotFound ValueError N/A err N/A N/A N/A N/A log error N/A N/A etcd: {0} format err N/A None N/A N/A MaxRetryError N/A err N/A N/A N/A N/A log error N/A N/A etcd: Could not connect to etcd server: {0} format err N/A None N/A N/A Exception N/A err N/A N/A N/A N/A log error N/A N/A etcd: uncaught exception {0} format err N/A N/A tree N/A N/A self path N/A N/A N/A 
        .. versionadded:: 2014.7.0

        Recurse through etcd and return all values
         N/A ret N/A N/A N/A N/A items N/A N/A self read path N/A N/A N/A N/A N/A etcd EtcdKeyNotFound ValueError N/A N/A None N/A N/A N/A etcd EtcdConnectionFailed N/A N/A N/A N/A log error N/A N/A etcd: failed to perform 'tree' operation on path {0} due to connection error format path N/A None N/A item N/A items children N/A N/A comps N/A N/A N/A str N/A item key split / N/A N/A N/A item dir True N/A N/A N/A N/A item key path N/A N/A N/A N/A ret N/A N/A comps N/A -1 N/A N/A self tree N/A item key N/A N/A N/A ret N/A N/A comps N/A -1 N/A item value N/A ret N/A N/A get_conn N/A N/A opts profile N/A None N/A N/A client N/A EtcdClient opts profile N/A client N/A tree N/A N/A client path N/A N/A N/A N/A N/A client tree path N/A