@@ -13,35 +13,35 @@ def sentinel(self, *args):
13
13
14
14
def sentinel_get_master_addr_by_name (self , service_name ):
15
15
"""Returns a (host, port) pair for the given ``service_name``"""
16
- return self .execute_command ("SENTINEL GET-MASTER-ADDR-BY-NAME" , service_name )
16
+ return self .execute_command ("SENTINEL GET-MASTER-ADDR-BY-NAME" , service_name , once = True )
17
17
18
18
def sentinel_master (self , service_name ):
19
19
"""Returns a dictionary containing the specified masters state."""
20
20
return self .execute_command ("SENTINEL MASTER" , service_name )
21
21
22
22
def sentinel_masters (self ):
23
23
"""Returns a list of dictionaries containing each master's state."""
24
- return self .execute_command ("SENTINEL MASTERS" )
24
+ return self .execute_command ("SENTINEL MASTERS" , once = True )
25
25
26
26
def sentinel_monitor (self , name , ip , port , quorum ):
27
27
"""Add a new master to Sentinel to be monitored"""
28
- return self .execute_command ("SENTINEL MONITOR" , name , ip , port , quorum )
28
+ return self .execute_command ("SENTINEL MONITOR" , name , ip , port , quorum , bool_resp = True )
29
29
30
30
def sentinel_remove (self , name ):
31
31
"""Remove a master from Sentinel's monitoring"""
32
- return self .execute_command ("SENTINEL REMOVE" , name )
32
+ return self .execute_command ("SENTINEL REMOVE" , name , bool_resp = True )
33
33
34
34
def sentinel_sentinels (self , service_name ):
35
35
"""Returns a list of sentinels for ``service_name``"""
36
36
return self .execute_command ("SENTINEL SENTINELS" , service_name )
37
37
38
38
def sentinel_set (self , name , option , value ):
39
39
"""Set Sentinel monitoring parameters for a given master"""
40
- return self .execute_command ("SENTINEL SET" , name , option , value )
40
+ return self .execute_command ("SENTINEL SET" , name , option , value , bool_resp = True )
41
41
42
42
def sentinel_slaves (self , service_name ):
43
43
"""Returns a list of slaves for ``service_name``"""
44
- return self .execute_command ("SENTINEL SLAVES" , service_name )
44
+ return self .execute_command ("SENTINEL SLAVES" , service_name , once = True )
45
45
46
46
def sentinel_reset (self , pattern ):
47
47
"""
@@ -52,7 +52,7 @@ def sentinel_reset(self, pattern):
52
52
failover in progress), and removes every slave and sentinel already
53
53
discovered and associated with the master.
54
54
"""
55
- return self .execute_command ("SENTINEL RESET" , pattern , once = True )
55
+ return self .execute_command ("SENTINEL RESET" , pattern , once = True , bool_resp = True )
56
56
57
57
def sentinel_failover (self , new_master_name ):
58
58
"""
@@ -61,7 +61,7 @@ def sentinel_failover(self, new_master_name):
61
61
configuration will be published so that the other Sentinels will
62
62
update their configurations).
63
63
"""
64
- return self .execute_command ("SENTINEL FAILOVER" , new_master_name )
64
+ return self .execute_command ("SENTINEL FAILOVER" , new_master_name , bool_resp = True )
65
65
66
66
def sentinel_ckquorum (self , new_master_name ):
67
67
"""
@@ -72,7 +72,7 @@ def sentinel_ckquorum(self, new_master_name):
72
72
This command should be used in monitoring systems to check if a
73
73
Sentinel deployment is ok.
74
74
"""
75
- return self .execute_command ("SENTINEL CKQUORUM" , new_master_name , once = True )
75
+ return self .execute_command ("SENTINEL CKQUORUM" , new_master_name , once = True , bool_resp = True )
76
76
77
77
def sentinel_flushconfig (self ):
78
78
"""
@@ -90,7 +90,7 @@ def sentinel_flushconfig(self):
90
90
This command works even if the previous configuration file is
91
91
completely missing.
92
92
"""
93
- return self .execute_command ("SENTINEL FLUSHCONFIG" )
93
+ return self .execute_command ("SENTINEL FLUSHCONFIG" , bool_resp = True )
94
94
95
95
96
96
class AsyncSentinelCommands (SentinelCommands ):
0 commit comments