1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

python:join: Fix references to undefined variables

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joseph Sutton 2023-08-28 13:11:21 +12:00 committed by Andrew Bartlett
parent b068592dd0
commit b076cad4b2

View File

@ -934,12 +934,12 @@ class DCJoinContext(object):
adprep_level = ctx.behavior_version adprep_level = ctx.behavior_version
updates_allowed_overridden = False updates_allowed_overridden = False
if lp.get("dsdb:schema update allowed") is None: if ctx.lp.get("dsdb:schema update allowed") is None:
lp.set("dsdb:schema update allowed", "yes") ctx.lp.set("dsdb:schema update allowed", "yes")
print("Temporarily overriding 'dsdb:schema update allowed' setting") print("Temporarily overriding 'dsdb:schema update allowed' setting")
updates_allowed_overridden = True updates_allowed_overridden = True
samdb.transaction_start() ctx.samdb.transaction_start()
try: try:
from samba.domain_update import DomainUpdate from samba.domain_update import DomainUpdate
@ -948,13 +948,13 @@ class DCJoinContext(object):
samba.dsdb.DS_DOMAIN_FUNCTION_2008, samba.dsdb.DS_DOMAIN_FUNCTION_2008,
update_revision=True) update_revision=True)
samdb.transaction_commit() ctx.samdb.transaction_commit()
except Exception as e: except Exception as e:
samdb.transaction_cancel() ctx.samdb.transaction_cancel()
raise DCJoinException("DomainUpdate() failed: %s" % e) raise DCJoinException("DomainUpdate() failed: %s" % e)
if updates_allowed_overridden: if updates_allowed_overridden:
lp.set("dsdb:schema update allowed", "no") ctx.lp.set("dsdb:schema update allowed", "no")
print("Provision OK for domain %s" % ctx.names.dnsdomain) print("Provision OK for domain %s" % ctx.names.dnsdomain)