1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

py:samdb: make SamDB.__str__ show the URL and ID

Getting the right samdb is going to matter more, so it is useful for
debugging to see which is which.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall 2024-03-14 14:15:47 +13:00 committed by Andrew Bartlett
parent ecd65265ac
commit c04ac95ce4

View File

@ -104,6 +104,14 @@ class SamDB(samba.Ldb):
super().connect(url=url, flags=flags, options=options)
def __repr__(self):
if self.url:
return f"<SamDB {id(self):x} ({self.url})>"
return f"<SamDB {id(self):x} (no connection)>"
__str__ = __repr__
def am_rodc(self):
"""return True if we are an RODC"""
return dsdb._am_rodc(self)