safer lookup of master_type

This commit is contained in:
Volker Schwicking 2014-07-03 21:17:45 +02:00
parent 6dcad5f65c
commit bd35eb77b9

View File

@ -148,7 +148,8 @@ class ZeroMQChannel(Channel):
key = self.sreq_key
if key not in ZeroMQChannel.sreq_cache:
if self.opts['master_type'] == 'failover':
master_type = self.opts.get('master_type', None)
if master_type == 'failover':
# remove all cached sreqs to the old master to prevent
# zeromq from reconnecting to old masters automagically
for check_key in self.sreq_cache.keys():