From ba74823c8f42dd3f4f0883163e42888ec35baf32 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 28 Mar 2010 22:58:36 +0200 Subject: upgradeprovision: Fix formatting, syntax error. --- source4/scripting/bin/upgradeprovision | 37 ++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'source4/scripting/bin') diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision index bdc58c3f59..8f01bd3bf0 100755 --- a/source4/scripting/bin/upgradeprovision +++ b/source4/scripting/bin/upgradeprovision @@ -41,7 +41,7 @@ from ldb import SCOPE_SUBTREE, SCOPE_BASE, \ from samba import param from samba import glue from samba.misc import messageEltFlagToString -from samba.provision import find_setup_dir, get_domain_descriptor, get_config_descriptor, secretsdb_self_join,set_gpo_acl,getpolicypath,create_gpo_struct +from samba.provision import find_setup_dir, get_domain_descriptor, get_config_descriptor, secretsdb_self_join,set_gpo_acl,getpolicypath,create_gpo_struct from samba.provisionexceptions import ProvisioningError from samba.schema import get_linked_attributes, Schema, get_schema_descriptor from samba.dcerpc import security @@ -871,22 +871,24 @@ def update_machine_account_password(paths, creds, session, names): def update_gpo(paths,creds,session,names): - """Create missing GPO file object if needed + """Create missing GPO file object if needed - Set ACL correctly also. - """ - dir = getpolicypath(paths.sysvol,names.dnsdomain,names.policyid) - if not os.path.isdir(dir): - create_gpo_struct(dir) - - dir = getpolicypath(paths.sysvol,names.dnsdomain,names.policyid_dc) - if not os.path.isdir(dir): - create_gpo_struct(dir) - samdb = Ldb(paths.samdb, session_info=session, credentials=creds,lp=lp) - set_gpo_acl(path.sysvol,names.dnsdomain,names.domainsid,names.domaindn,samdb,lp) - -def updateOEMInfo(paths,creds,session,names): - sam_ldb = Ldb(paths.samdb, session_info=session, credentials=creds,lp=lp, options=["modules:samba_dsdb"]) + Set ACL correctly also. + """ + dir = getpolicypath(paths.sysvol,names.dnsdomain,names.policyid) + if not os.path.isdir(dir): + create_gpo_struct(dir) + + dir = getpolicypath(paths.sysvol,names.dnsdomain,names.policyid_dc) + if not os.path.isdir(dir): + create_gpo_struct(dir) + samdb = Ldb(paths.samdb, session_info=session, credentials=creds,lp=lp) + set_gpo_acl(paths.sysvol, names.dnsdomain, names.domainsid, + names.domaindn, samdb, lp) + +def updateOEMInfo(paths, creds, session,names): + sam_ldb = Ldb(paths.samdb, session_info=session, credentials=creds, lp=lp, + options=["modules:samba_dsdb"]) res = sam_ldb.search(expression="(objectClass=*)",base=str(names.rootdn), scope=SCOPE_BASE, attrs=["dn","oEMInformation"]) if len(res) > 0: @@ -895,7 +897,8 @@ def updateOEMInfo(paths,creds,session,names): delta = Message() delta.dn = Dn(sam_ldb,str(res[0]["dn"])) descr = get_schema_descriptor(names.domainsid) - delta["oEMInformation"] = MessageElement(info, FLAG_MOD_REPLACE, "oEMInformation" ) + delta["oEMInformation"] = MessageElement(info, FLAG_MOD_REPLACE, + "oEMInformation" ) sam_ldb.modify(delta) -- cgit