From: Noel Power Date: Fri, 15 Jun 2018 09:58:13 +0000 (+0100) Subject: s4/torture/drs/python: py2/py3 port map / ord usage X-Git-Tag: ldb-1.5.0~290 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06d3eac8a1f74b2954f6ca01a8ee3c33c23f1df5;p=thirdparty%2Fsamba.git s4/torture/drs/python: py2/py3 port map / ord usage Signed-off-by: Noel Power Reviewed-by: Andreas Schneider Reviewed-by: Douglas Bagnall --- diff --git a/source4/torture/drs/python/getnc_exop.py b/source4/torture/drs/python/getnc_exop.py index e29e346b3eb..9d1b6ee038d 100644 --- a/source4/torture/drs/python/getnc_exop.py +++ b/source4/torture/drs/python/getnc_exop.py @@ -924,17 +924,20 @@ class DrsReplicaPrefixMapTestCase(drs_base.DrsBaseTestCase): schi = drsuapi.DsReplicaOIDMapping() schi.id_prefix = 0 - if 'schemaInfo' in res[0]: - schi.oid.length = len(map(ord, str(res[0]['schemaInfo']))) - schi.oid.binary_oid = map(ord, str(res[0]['schemaInfo'])) + binary_oid = [x if isinstance(x, int) else ord(x) for x in res[0]['schemaInfo'][0]] + schi.oid.length = len(binary_oid) + schi.oid.binary_oid = binary_oid else: schema_info = drsblobs.schemaInfoBlob() schema_info.revision = 0 schema_info.marker = 0xFF schema_info.invocation_id = misc.GUID(samdb.get_invocation_id()) - schi.oid.length = len(map(ord, ndr_pack(schema_info))) - schi.oid.binary_oid = map(ord, ndr_pack(schema_info)) + + binary_oid = [x if isinstance(x, int) else ord(x) for x in ndr_pack(schema_info)] + # you have to set the length before setting binary_oid + schi.oid.length = len(binary_oid) + schi.oid.binary_oid = binary_oid pfm.ctr.mappings = pfm.ctr.mappings + [schi] pfm.ctr.num_mappings += 1