mirror of
https://github.com/samba-team/samba.git
synced 2025-09-10 05:44:20 +03:00
py:samdb: drop unused methods (get_binary_integer, get_bytes)
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>
This commit is contained in:
committed by
Douglas Bagnall
parent
45f7444d60
commit
588a1566ef
@@ -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
|
||||
|
Reference in New Issue
Block a user