summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorGarming Sam <garming@catalyst.net.nz>2017-03-08 17:17:27 +1300
committerAndrew Bartlett <abartlet@samba.org>2017-03-13 05:10:10 +0100
commit213349b4bfc10cb24a8555f2cb5aea0a17379836 (patch)
treecd712f3f402441aa7451ebd202334feb65baacec /python
parentee04f96b69eb7f7ea6f073cf8228f32252725f8e (diff)
downloadsamba-213349b4bfc10cb24a8555f2cb5aea0a17379836.tar.gz
python/dsdb_dn: Add a generic get_bytes method on DNs
Pair-programmed-with: Bob Campbell <bobcampbell@catalyst.net.nz> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python')
-rw-r--r--python/samba/common.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/python/samba/common.py b/python/samba/common.py
index c2a3584732c..20f170cf36e 100644
--- a/python/samba/common.py
+++ b/python/samba/common.py
@@ -19,6 +19,7 @@
import ldb
import dsdb
+import binascii
def confirm(msg, forced=False, allow_all=False):
@@ -97,3 +98,7 @@ class dsdb_Dn(object):
if self.prefix == '':
return None
return int(self.binary, 16)
+
+ def get_bytes(self):
+ '''return binary as a byte string'''
+ return binascii.unhexlify(self.binary)