Skip to content

Commit

Permalink
allow Optional int for port
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson committed Oct 14, 2021
1 parent 9c8c6b2 commit b464459
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sydent/replication/peer.py
Expand Up @@ -132,15 +132,17 @@ def __init__(
:param lastSentVersion: The ID of the last association sent to the peer.
"""
super().__init__(server_name, pubkeys)

if port is None:
port = 1001

self.sydent = sydent
self.lastSentVersion = lastSentVersion

# look up or build the replication URL
replication_url = self.sydent.config.http.base_replication_urls.get(server_name)

if replication_url is None:
if not port:
port = 1001
replication_url = "https://%s:%i" % (server_name, port)

if replication_url[-1:] != "/":
Expand Down

0 comments on commit b464459

Please sign in to comment.