From d486e4ce6f8aa2ae455345f25ac26f71de2ba21b Mon Sep 17 00:00:00 2001 From: Garming Sam Date: Fri, 23 Jan 2015 09:43:55 +1300 Subject: [PATCH] samba_kcc: Fix existing syntax errors preventing samba_kcc from running Signed-off-by: Garming Sam Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- python/samba/kcc_utils.py | 10 +++++----- source4/scripting/bin/samba_kcc | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/python/samba/kcc_utils.py b/python/samba/kcc_utils.py index 9c6b76251b6..b10bf78bf7a 100644 --- a/python/samba/kcc_utils.py +++ b/python/samba/kcc_utils.py @@ -73,7 +73,7 @@ class NamingContext(object): scope=ldb.SCOPE_BASE, attrs=attrs) except ldb.LdbError, (enum, estr): - raise Exception("Unable to find naming context (%s)" % + raise Exception("Unable to find naming context (%s) - (%s)" % (self.nc_dnstr, estr)) msg = res[0] if "objectGUID" in msg: @@ -375,7 +375,7 @@ class NCReplica(NamingContext): except ldb.LdbError, estr: raise Exception("Could not set repsFrom for (%s) - (%s)" % - (self.dsa_dnstr, estr)) + (self.nc_dnstr, estr)) def dumpstr_to_be_deleted(self): text="" @@ -906,7 +906,7 @@ class NTDSConnection(object): self.load_connection_transport(samdb, str(dsdn.dn)) if "schedule" in msg: - self.schedule = ndr_unpack(drsblobs.replSchedule, msg["schedule"][0]) + self.schedule = ndr_unpack(drsblobs.schedule, msg["schedule"][0]) if "whenCreated" in msg: self.whenCreated = ldb.string_to_time(msg["whenCreated"][0]) @@ -928,7 +928,7 @@ class NTDSConnection(object): scope=ldb.SCOPE_BASE, attrs=attrs) except ldb.LdbError, (enum, estr): - raise Exception("Unable to find transport (%s)" % + raise Exception("Unable to find transport (%s) - (%s)" % (tdnstr, estr)) if "objectGUID" in res[0]: @@ -1783,7 +1783,7 @@ class GraphNode(object): flags = dsdb.SYSTEM_FLAG_CONFIG_ALLOW_RENAME + \ dsdb.SYSTEM_FLAG_CONFIG_ALLOW_MOVE - dsa.create_connection(opt, flags, None, edge_dnstr, None) + dsa.new_connection(opt, flags, None, edge_dnstr, None) def has_sufficient_edges(self): '''Return True if we have met the maximum "from edges" criteria''' diff --git a/source4/scripting/bin/samba_kcc b/source4/scripting/bin/samba_kcc index cfd4d7e166b..b0f3fb71c51 100755 --- a/source4/scripting/bin/samba_kcc +++ b/source4/scripting/bin/samba_kcc @@ -654,7 +654,7 @@ class KCC(object): res = self.samdb.search(base=pdnstr, scope=ldb.SCOPE_BASE, attrs=attrs) - except ldb.ldbError, (enum, estr): + except ldb.LdbError, (enum, estr): raise Exception( "Unable to find attr (%s) for (%s) - (%s)" % (x_transport.address_attr, pdnstr, estr)) @@ -1027,7 +1027,7 @@ class KCC(object): res = self.samdb.search(base=pdnstr, scope=ldb.SCOPE_BASE, attrs=attrs) - except ldb.ldbError, (enum, estr): + except ldb.LdbError, (enum, estr): continue msg = res[0] @@ -1272,7 +1272,7 @@ class KCC(object): # NTDSCONN_OPT_USE_NOTIFY in opt if (link_opt & dsdb.NTDSSITELINK_OPT_USE_NOTIFY) != 0: opt |= (dsdb.NTDSCONN_OPT_OVERRIDE_NOTIFY_DEFAULT | - dsdb.NTDSCONN_USE_NOTIFY) + dsdb.NTDSCONN_OPT_USE_NOTIFY) # IF bit NTDSSITELINK_OPT_TWOWAY_SYNC is set in ri.Options # SET bit NTDSCONN_OPT_TWOWAY_SYNC opt