MCPcopy
hub / github.com/redis/redis-py / set_default_node

Method set_default_node

redis/asyncio/cluster.py:692–701  ·  view source on GitHub ↗

Set the default node of the client. :raises DataError: if None is passed or node does not exist in cluster.

(self, node: "ClusterNode")

Source from the content-addressed store, hash-verified

690 return self.nodes_manager.default_node
691
692 def set_default_node(self, node: "ClusterNode") -> None:
693 """
694 Set the default node of the client.
695
696 :raises DataError: if None is passed or node does not exist in cluster.
697 """
698 if not node or not self.get_node(node_name=node.name):
699 raise DataError("The requested node does not exist in the cluster.")
700
701 self.nodes_manager.default_node = node
702
703 def get_node(
704 self,

Callers

nothing calls this directly

Calls 2

get_nodeMethod · 0.95
DataErrorClass · 0.90

Tested by

no test coverage detected