]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
py:samdb: drop unused methods (get_binary_integer, get_bytes)
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 30 Jul 2025 02:51:32 +0000 (14:51 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Thu, 7 Aug 2025 23:28:33 +0000 (23:28 +0000)
get_binary_integer() is still a method on BinaryDn, but not on
StringDn and PlainDn where it makes no sense.

x.get_bytes() is merely an alias for x.binary.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
python/samba/samdb.py

index 47a8399321fca17b9e9fe31057e2669c4f43ded1..483bfd7a71ccd169f37296a64d3fa48ea4fc4288 100644 (file)
@@ -28,7 +28,7 @@ import time
 import base64
 import os
 import re
-from typing import Optional, Union
+from typing import Union
 
 from samba import dsdb, dsdb_dns
 from samba.ndr import ndr_unpack, ndr_pack
@@ -1737,18 +1737,10 @@ class BaseDsdbDn:
     def __ge__(self, other):
         return self.__cmp__(other) >= 0
 
-    def get_bytes(self) -> Optional[bytes]:
-        return self.binary
-
     def __str__(self) -> str:
         dnstr = self.dn.extended_str(mode=1)
         return f"{self.prefix}{dnstr}"
 
-    def get_binary_integer(self) -> int:
-        # Overridden in BinaryDn to return the binary value as an integer.
-        # We will remove it from here soon.
-        return 0
-
 
 class PlainDn(BaseDsdbDn):
     """This does very little, other than providing the sort order (via