diff options
author | Matthieu Patou <mat@matws.net> | 2011-06-13 18:34:49 +0400 |
---|---|---|
committer | Matthieu Patou <mat@samba.org> | 2011-06-19 23:21:08 +0200 |
commit | 71ab462c81b48169b34d60dd2bbeca137a15b702 (patch) | |
tree | 827848bf676276629e2eb37c386bc2bfcf3f198d /source4 | |
parent | d9abcc93847fedf3ca272fe69cde0a92e76c85d0 (diff) | |
download | samba-71ab462c81b48169b34d60dd2bbeca137a15b702.tar.gz samba-71ab462c81b48169b34d60dd2bbeca137a15b702.tar.bz2 samba-71ab462c81b48169b34d60dd2bbeca137a15b702.zip |
s4-upgradeprovision: add function to know if attribute is replicated or not
Diffstat (limited to 'source4')
-rwxr-xr-x | source4/scripting/bin/upgradeprovision | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision index db42543723..a9dffc0ab5 100755 --- a/source4/scripting/bin/upgradeprovision +++ b/source4/scripting/bin/upgradeprovision @@ -117,6 +117,7 @@ hashOverwrittenAtt = { "prefixMap": replace, "systemMayContain": replace, backlinked = [] forwardlinked = set() dn_syntax_att = [] +not_replicated = [] def define_what_to_log(opts): what = 0 if opts.debugchange: @@ -238,6 +239,25 @@ def populate_links(samdb, schemadn): for t in linkedAttHash.keys(): forwardlinked.add(t) +def isReplicated(att): + """ Indicate if the attribute is replicated or not + + :param att: Name of the attribute to be tested + :return: True is the attribute is replicated, False otherwise + """ + + return (att not in not_replicated) + +def populateNotReplicated(samdb, schemadn): + """Populate an array with all the attributes that are not replicated + + :param samdb: A LDB object for sam.ldb file + :param schemadn: DN of the schema for the partition""" + res = samdb.search(expression="(&(objectclass=attributeSchema)(systemflags:1.2.840.113556.1.4.803:=1))", base=Dn(samdb, + str(schemadn)), scope=SCOPE_SUBTREE, + attrs=["lDAPDisplayName"]) + for elem in res: + not_replicated.append(elem["lDAPDisplayName"]) def populate_dnsyntax(samdb, schemadn): """Populate an array with all the attributes that have DN synthax |