summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBar Shaul <barshaul@amazon.com>2022-09-10 20:28:49 +0300
committerBar Shaul <barshaul@amazon.com>2022-11-02 16:47:10 +0200
commit7ece39e95c6565f137ca13511152dcf9be5222c0 (patch)
treea62a81abc3d1712b70440016ed0587530eb0d37e
parentdad144bc40f983aa92758e690b0a24bf39e8c610 (diff)
downloadredis-py-7ece39e95c6565f137ca13511152dcf9be5222c0.tar.gz
Fixed linters
-rw-r--r--redis/asyncio/cluster.py6
-rw-r--r--redis/cluster.py10
-rw-r--r--tests/test_asyncio/test_cluster.py2
3 files changed, 9 insertions, 9 deletions
diff --git a/redis/asyncio/cluster.py b/redis/asyncio/cluster.py
index 07d0688..cc574b3 100644
--- a/redis/asyncio/cluster.py
+++ b/redis/asyncio/cluster.py
@@ -707,7 +707,7 @@ class RedisCluster(AbstractRedis, AbstractRedisCluster, AsyncRedisClusterCommand
return await target_node.execute_command(*args, **kwargs)
except (BusyLoadingError, MaxConnectionsError):
raise
- except (ConnectionError, TimeoutError) as e:
+ except (ConnectionError, TimeoutError):
# Connection retries are being handled in the node's
# Retry object.
# Remove the failed node from the startup nodes before we try
@@ -1163,8 +1163,8 @@ class NodesManager:
if not startup_nodes_reachable:
raise RedisClusterException(
- f"Redis Cluster cannot be connected. Please provide at least "
- f"one reachable node"
+ "Redis Cluster cannot be connected. Please provide at least "
+ "one reachable node"
) from exception
# Check if the slots are not fully covered
diff --git a/redis/cluster.py b/redis/cluster.py
index 38ee7cc..08d8238 100644
--- a/redis/cluster.py
+++ b/redis/cluster.py
@@ -1,4 +1,3 @@
-import copy
import random
import socket
import sys
@@ -474,8 +473,9 @@ class RedisCluster(AbstractRedisCluster, RedisClusterCommands):
If you use dynamic DNS endpoints for startup nodes but CLUSTER SLOTS lists
specific IP addresses, it is best to set it to false.
:param cluster_error_retry_attempts:
- Number of times to retry before raising an error when :class:`~.TimeoutError`
- or :class:`~.ConnectionError` or :class:`~.ClusterDownError` are encountered
+ Number of times to retry before raising an error when
+ :class:`~.TimeoutError` or :class:`~.ConnectionError` or
+ :class:`~.ClusterDownError` are encountered
:param connection_error_retry_attempts:
Number of times to retry before reinitializing when :class:`~.TimeoutError`
or :class:`~.ConnectionError` are encountered.
@@ -1510,8 +1510,8 @@ class NodesManager:
if not startup_nodes_reachable:
raise RedisClusterException(
- f"Redis Cluster cannot be connected. Please provide at least "
- f"one reachable node"
+ "Redis Cluster cannot be connected. Please provide at least "
+ "one reachable node"
) from exception
# Create Redis connections to all nodes
diff --git a/tests/test_asyncio/test_cluster.py b/tests/test_asyncio/test_cluster.py
index 04f0b1a..09639de 100644
--- a/tests/test_asyncio/test_cluster.py
+++ b/tests/test_asyncio/test_cluster.py
@@ -14,7 +14,7 @@ from redis.asyncio.cluster import ClusterNode, NodesManager, RedisCluster
from redis.asyncio.connection import Connection, SSLConnection
from redis.asyncio.parser import CommandsParser
from redis.asyncio.retry import Retry
-from redis.backoff import get_default_backoff, ExponentialBackoff, NoBackoff
+from redis.backoff import ExponentialBackoff, NoBackoff, get_default_backoff
from redis.cluster import PIPELINE_BLOCKED_COMMANDS, PRIMARY, REPLICA, get_node_name
from redis.crc import REDIS_CLUSTER_HASH_SLOTS, key_slot
from redis.exceptions import (