diff options
author | Anas <anas.el.amraoui@live.com> | 2021-11-30 18:05:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-30 18:05:51 +0200 |
commit | b94e230b17d08e6c89d134e933c706256b79bc4a (patch) | |
tree | 993bd7565169229326b810b66939587431ab9dc6 /redis/commands/sentinel.py | |
parent | 368a25f9d163d784a8896f1c087582405e98e006 (diff) | |
download | redis-py-b94e230b17d08e6c89d134e933c706256b79bc4a.tar.gz |
Added black and isort (#1734)
Diffstat (limited to 'redis/commands/sentinel.py')
-rw-r--r-- | redis/commands/sentinel.py | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/redis/commands/sentinel.py b/redis/commands/sentinel.py index 1f02984..a9b06c2 100644 --- a/redis/commands/sentinel.py +++ b/redis/commands/sentinel.py @@ -9,41 +9,39 @@ class SentinelCommands: def sentinel(self, *args): "Redis Sentinel's SENTINEL command." - warnings.warn( - DeprecationWarning('Use the individual sentinel_* methods')) + warnings.warn(DeprecationWarning("Use the individual sentinel_* methods")) def sentinel_get_master_addr_by_name(self, service_name): "Returns a (host, port) pair for the given ``service_name``" - return self.execute_command('SENTINEL GET-MASTER-ADDR-BY-NAME', - service_name) + return self.execute_command("SENTINEL GET-MASTER-ADDR-BY-NAME", service_name) def sentinel_master(self, service_name): "Returns a dictionary containing the specified masters state." - return self.execute_command('SENTINEL MASTER', service_name) + return self.execute_command("SENTINEL MASTER", service_name) def sentinel_masters(self): "Returns a list of dictionaries containing each master's state." - return self.execute_command('SENTINEL MASTERS') + return self.execute_command("SENTINEL MASTERS") def sentinel_monitor(self, name, ip, port, quorum): "Add a new master to Sentinel to be monitored" - return self.execute_command('SENTINEL MONITOR', name, ip, port, quorum) + return self.execute_command("SENTINEL MONITOR", name, ip, port, quorum) def sentinel_remove(self, name): "Remove a master from Sentinel's monitoring" - return self.execute_command('SENTINEL REMOVE', name) + return self.execute_command("SENTINEL REMOVE", name) def sentinel_sentinels(self, service_name): "Returns a list of sentinels for ``service_name``" - return self.execute_command('SENTINEL SENTINELS', service_name) + return self.execute_command("SENTINEL SENTINELS", service_name) def sentinel_set(self, name, option, value): "Set Sentinel monitoring parameters for a given master" - return self.execute_command('SENTINEL SET', name, option, value) + return self.execute_command("SENTINEL SET", name, option, value) def sentinel_slaves(self, service_name): "Returns a list of slaves for ``service_name``" - return self.execute_command('SENTINEL SLAVES', service_name) + return self.execute_command("SENTINEL SLAVES", service_name) def sentinel_reset(self, pattern): """ @@ -54,7 +52,7 @@ class SentinelCommands: failover in progress), and removes every slave and sentinel already discovered and associated with the master. """ - return self.execute_command('SENTINEL RESET', pattern, once=True) + return self.execute_command("SENTINEL RESET", pattern, once=True) def sentinel_failover(self, new_master_name): """ @@ -63,7 +61,7 @@ class SentinelCommands: configuration will be published so that the other Sentinels will update their configurations). """ - return self.execute_command('SENTINEL FAILOVER', new_master_name) + return self.execute_command("SENTINEL FAILOVER", new_master_name) def sentinel_ckquorum(self, new_master_name): """ @@ -74,9 +72,7 @@ class SentinelCommands: This command should be used in monitoring systems to check if a Sentinel deployment is ok. """ - return self.execute_command('SENTINEL CKQUORUM', - new_master_name, - once=True) + return self.execute_command("SENTINEL CKQUORUM", new_master_name, once=True) def sentinel_flushconfig(self): """ @@ -94,4 +90,4 @@ class SentinelCommands: This command works even if the previous configuration file is completely missing. """ - return self.execute_command('SENTINEL FLUSHCONFIG') + return self.execute_command("SENTINEL FLUSHCONFIG") |