Skip to content

Commit

Permalink
fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
grippy committed Aug 1, 2022
1 parent 9d036ce commit ab45876
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions redis/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ def determine_slot(self, *args):
if len(args) <= 2:
raise RedisClusterException(f"Invalid args in command: {args}")
num_actual_keys = args[2]
eval_keys = args[3: 3 + num_actual_keys]
eval_keys = args[3 : 3 + num_actual_keys]
# if there are 0 keys, that means the script can be run on any node
# so we can just return a random slot
if len(eval_keys) == 0:
Expand Down Expand Up @@ -1908,14 +1908,16 @@ def _send_cluster_commands(
target_nodes = self._parse_target_nodes(passed_targets)
else:
target_nodes = self._determine_nodes(
*c.args, node_flag=passed_targets)
*c.args, node_flag=passed_targets
)
if not target_nodes:
raise RedisClusterException(
f"No targets were found to execute {c.args} command on"
)
if len(target_nodes) > 1:
raise RedisClusterException(
f"Too many targets for command {c.args}")
f"Too many targets for command {c.args}"
)

node = target_nodes[0]

Expand All @@ -1938,7 +1940,7 @@ def _send_cluster_commands(
nodes[node_name] = NodeCommands(
redis_node.parse_response,
redis_node.connection_pool,
connection
connection,
)
nodes[node_name].append(c)
break
Expand Down

0 comments on commit ab45876

Please sign in to comment.