File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/memcached.cpython-310.pyc
Back
o ;j0 � @ s� d Z ddlZddlmZmZ zddlZdZW n ey! dZY nw dZdZ dZ dZe�e �Zdd iZd d� Zddd �Zdd� Ze efdd�Zdd� ZdS )a� Utilities for working with memcache :depends: - python-memcached This library sets up a connection object for memcache, using the configuration passed into the get_conn() function. Normally, this is __opts__. Optionally, a profile or specific host and port may be passed in. If neither profile nor host and port are provided, the defaults of '`127.0.0.`` and ``11211`` are used. The following configurations are both valid: .. code-block:: yaml # No profile name memcached.host: 127.0.0.1 memcached.port: 11211 # One or more profiles defined my_memcached_config: memcached.host: 127.0.0.1 memcached.port: 11211 Once configured, the get_conn() function is passed a set of opts, and, optionally, the name of a profile to be used. .. code-block:: python import salt.utils.memcached_utils.py conn = salt.utils.memcached_utils.get_conn(__opts__, profile='my_memcached_config') It should be noted that some usages of memcached may 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. � N)�CommandExecutionError�SaltInvocationErrorTFz 127.0.0.1i�+ �set_�setc C s t rdS dS )z4 Only load if python-memcached is installed TF)�HAS_LIBS� r r �H/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/memcached.py�__virtual__>