From c04ac95ce404f13183688c2d0d7f1eeb0edc4c4b Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Thu, 14 Mar 2024 14:15:47 +1300 Subject: [PATCH] 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 Reviewed-by: Andrew Bartlett --- python/samba/samdb.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python/samba/samdb.py b/python/samba/samdb.py index 085dff43848..b831cf56250 100644 --- a/python/samba/samdb.py +++ b/python/samba/samdb.py @@ -104,6 +104,14 @@ class SamDB(samba.Ldb): super().connect(url=url, flags=flags, options=options) + def __repr__(self): + if self.url: + return f"" + + return f"" + + __str__ = __repr__ + def am_rodc(self): """return True if we are an RODC""" return dsdb._am_rodc(self) -- 2.11.4.GIT