golden hour
/opt/saltstack/salt/lib/python3.10/site-packages/salt/tokens/__pycache__
⬆️ Go Up
Upload
File/Folder
Size
Actions
__init__.cpython-310.pyc
590 B
Del
OK
localfs.cpython-310.pyc
3.14 KB
Del
OK
rediscluster.cpython-310.pyc
4.16 KB
Del
OK
Edit: rediscluster.cpython-310.pyc
o �xe� � @ s� d Z ddlZddlZddlZddlZddlmZ zddlZdZ W n e y+ dZ Y nw e�e�Z dZdd� Zd d � Zdd� Zd d� Zdd� Zdd� ZdS )a� Provide token storage in Redis cluster. To get started simply start a redis cluster and assign all hashslots to the connected nodes. Add the redis hostname and port to master configs as eauth_redis_host and eauth_redis_port. Default values for these configs are as follow: .. code-block:: yaml eauth_redis_host: localhost eauth_redis_port: 6379 :depends: - redis-py-cluster Python package � N)�DEFAULT_HASH_TYPETF�redisclusterc C s t sdS tS )N)FzLCould not use redis for tokens; rediscluster python client is not installed.)� HAS_REDIS�__virtualname__� r r �L/opt/saltstack/salt/lib/python3.10/site-packages/salt/tokens/rediscluster.py�__virtual__$ s r c C sf | � dd�}| � dd�}z tj||dd�W S tjjy2 } zt�d|||� W Y d}~dS d}~ww ) z| Connect to the redis host and return a StrictRedisCluster client object. If connection fails then return None. Zeauth_redis_hostZ localhostZeauth_redis_porti� T)�host�portZdecode_responsesz(Failed to connect to redis at %s:%s - %sN)�getr ZStrictRedisCluster� exceptionsZRedisClusterException�log�warning)�optsZ redis_hostZ redis_port�errr r r � _redis_client. s ����r c C s t | �}|si S tt| �dt��}t|t�d���� �}z|�|�dur6t|t�d���� �}|�|�dus$W n t yR } zt �d||� i W Y d}~S d}~ww ||d<