mirror of
https://github.com/samba-team/samba.git
synced 2025-07-13 08:59:08 +03:00
Allow ms_schema.py to produce output much like minschema_wspp
I've patched the new ms_schema.py (which was intended to be used as a library) to function as minschema_wspp if invoked standalone. Although this is less robust than minschema_wspp on incorrect data, having two programs doing the same thing might not be good idea. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Andrew Bartlett
parent
17aac8cad2
commit
8352650fee
@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# create schema.ldif (as a string) from WSPP documentation
|
||||
#
|
||||
@ -252,3 +253,17 @@ def read_ms_schema(attr_file, classes_file, dump_attributes = True, dump_classes
|
||||
classes_ldif = __parse_schema_file(classes_file, "classSchema")
|
||||
|
||||
return attr_ldif + "\n\n" + classes_ldif + "\n\n"
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
|
||||
try:
|
||||
attr_file = sys.argv[1]
|
||||
classes_file = sys.argv[2]
|
||||
except IndexError:
|
||||
print >>sys.stderr, "Usage: %s attr-file.txt classes-file.txt" % (sys.argv[0])
|
||||
sys.exit(1)
|
||||
|
||||
print read_ms_schema(attr_file, classes_file)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user