Merge "Fix matchmaker_redis ack_alive fails with KeyError"
This commit is contained in:
@@ -105,7 +105,7 @@ class MatchMakerRedis(mm_common.HeartbeatMatchMakerBase):
|
|||||||
# If we could not update the expiration, the key
|
# If we could not update the expiration, the key
|
||||||
# might have been pruned. Re-register, creating a new
|
# might have been pruned. Re-register, creating a new
|
||||||
# key in Redis.
|
# key in Redis.
|
||||||
self.register(self.host_topic[host], host)
|
self.register(key, host)
|
||||||
|
|
||||||
def is_alive(self, topic, host):
|
def is_alive(self, topic, host):
|
||||||
if self.redis.ttl(host) == -1:
|
if self.redis.ttl(host) == -1:
|
||||||
|
|||||||
@@ -81,3 +81,9 @@ class RedisMatchMakerTest(test_utils.BaseTestCase):
|
|||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
sorted(self.matcher.redis.smembers('conductor')),
|
sorted(self.matcher.redis.smembers('conductor')),
|
||||||
['conductor.node1', 'conductor.node2', 'conductor.node3'])
|
['conductor.node1', 'conductor.node2', 'conductor.node3'])
|
||||||
|
|
||||||
|
def test_ack_alive(self):
|
||||||
|
self.matcher.ack_alive('ack_alive', 'controller1')
|
||||||
|
self.assertEqual(
|
||||||
|
sorted(self.matcher.redis.smembers('ack_alive')),
|
||||||
|
['ack_alive.controller1'])
|
||||||
|
|||||||
Reference in New Issue
Block a user