python/samba: PY3 port samba4.blackbox.functionalprep
authorNoel Power <noel.power@suse.com>
Mon, 8 Oct 2018 14:21:45 +0000 (15:21 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 23 Oct 2018 03:50:28 +0000 (05:50 +0200)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/forest_update.py
python/samba/ms_forest_updates_markdown.py

index ba6f859a9438909b325db31a37eebd14bffff595..985e9f98e4320e2f2f48ba1f8a3fd360af245f5d 100644 (file)
@@ -346,7 +346,7 @@ objectClass: container
                                 controls=["search_options:1:2"])
 
         assert len(msg) == 1
-        existing_sddl = msg[0][attr][0]
+        existing_sddl = str(msg[0][attr][0])
         index = existing_sddl.rfind("S:")
         if index != -1:
             new_sddl = existing_sddl[:index] + ace + existing_sddl[index:]
index 3afe2ecb8387c5c12cc3c939d807df3f17333cf4..26cc3fd776a23a7c3d26a53a22d2f9fed94d7e35 100644 (file)
@@ -27,6 +27,7 @@ import re
 import os
 import markdown
 import xml.etree.ElementTree as ET
+from samba.compat import get_string
 
 
 # Display specifier updates or otherwise (ignored in forest_update.py)
@@ -217,7 +218,7 @@ def read_ms_markdown(in_file, out_folder=None, out_dict={}):
         if node.text and node.text.startswith('|Operation'):
             # Strip first and last |
             updates = [x[1:len(x) - 1].split('|') for x in
-                       ET.tostring(node, method='text').splitlines()]
+                       get_string(ET.tostring(node, method='text')).splitlines()]
             for update in updates[2:]:
                 output = re.match('Operation (\d+): {(.*)}', update[0])
                 if output: