Univention Bugzilla – Attachment 5839 Details for
Bug 34406
Missing ordering of LDAP schema
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Stable local-schema include file hhhorder
3440x_slapd-local-schema.diff (text/plain), 1.40 KB, created by
Philipp Hahn
on 2014-03-26 19:13 CET
(
hide
)
Description:
Stable local-schema include file hhhorder
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2014-03-26 19:13 CET
Size:
1.40 KB
patch
obsolete
>@!@ >import os >import re >import subprocess > >REGISTEREDDIRECTORY = '/etc/univention/templates/info' >def getRegisteredFiles(): > files = set() > for f in os.listdir(REGISTEREDDIRECTORY): > path = os.path.join(REGISTEREDDIRECTORY, f) > for line in open(path, 'r'): > if line.startswith('File: '): > files.add(line[len('File: '):].strip()) > elif line.startswith('Subfile: '): > files.add(line[len('Subfile: '):].strip()) > > return files > > >DIRECTORYPATH = '/etc/univention/templates/files/etc/ldap/slapd.conf.d' >def isSchemaFileIncluded(schemaFile, registeredFiles): > regexp = r'include\b.*/\d*%s\b' % (re.escape(schemaFile),) > pattern = re.compile(regexp) > > for f in os.listdir(DIRECTORYPATH): > if f == '25univention-ldap-server_local-schema' or f.startswith('.'): > continue > if not 'etc/ldap/slapd.conf.d/%s' % f in registeredFiles: > continue > path = os.path.join(DIRECTORYPATH, f) > > proc = subprocess.Popen(("ucr", "filter"), stdin=open(path, 'rb'), stdout=subprocess.PIPE) > for line in proc.stdout: > if pattern.search(line): > return True > > return False > > >LOCALPATH = '/var/lib/univention-ldap/local-schema' >if configRegistry.get('ldap/server/type', 'slave') == 'master': > if os.path.exists(LOCALPATH): > registeredFiles = getRegisteredFiles() > for schemaFile in sorted(os.listdir(LOCALPATH)): > if not isSchemaFileIncluded(schemaFile, registeredFiles): > print 'include %s/%s' % (LOCALPATH, schemaFile) >@!@
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 34406
: 5839