Wrap ipv6 in [] when displaying/logging messages

This commit is contained in:
Simon Li
2025-01-26 16:22:15 +00:00
parent c7bb995f29
commit ec83356261
3 changed files with 8 additions and 5 deletions

View File

@@ -157,7 +157,8 @@ class Server(Base):
spawner = relationship("Spawner", back_populates="server", uselist=False)
def __repr__(self):
return f"<Server({self.ip}:{self.port})>"
ip = f"[{self.ip}]" if ":" in self.ip else self.ip
return f"<Server({ip}:{self.port})>"
# lots of things have roles