Skip to content

Commit

Permalink
Fix for redis additional peers undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkneipp committed Jan 13, 2024
1 parent 9157c93 commit edeca3a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/diameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ def __init__(self, logTool, originHost: str="hss01", originRealm: str="epc.mnc99
The below handling of additional peers is deprecated and will be replaced with redis sentinel in the next major refactor.
"""
self.redisPeerConnections = []
for additionalPeer in self.redisAdditionalPeers:
additionalPeerHost = additionalPeer.split(':')[0]
additionalPeerPort = additionalPeer.split(':')[1]
redisPeerConnection = RedisMessaging(host=self.redisHost, port=self.redisPort, useUnixSocket=False, unixSocketPath=self.redisUnixSocketPath)
self.redisPeerConnections.append({"peer": additionalPeer, "connection": Redis(host=additionalPeerHost, port=additionalPeerPort)})
if self.redisAdditionalPeers:
for additionalPeer in self.redisAdditionalPeers:
additionalPeerHost = additionalPeer.split(':')[0]
additionalPeerPort = additionalPeer.split(':')[1]
redisPeerConnection = RedisMessaging(host=self.redisHost, port=self.redisPort, useUnixSocket=False, unixSocketPath=self.redisUnixSocketPath)
self.redisPeerConnections.append({"peer": additionalPeer, "connection": Redis(host=additionalPeerHost, port=additionalPeerPort)})

self.database = Database(logTool=logTool)
self.diameterRequestTimeout = int(self.config.get('hss', {}).get('diameter_request_timeout', 10))
Expand Down

0 comments on commit edeca3a

Please sign in to comment.