summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorBob Campbell <bobcampbell@catalyst.net.nz>2017-01-12 14:39:52 +1300
committerAndrew Bartlett <abartlet@samba.org>2017-02-14 09:46:22 +0100
commit99e41a377e7b4c64a0a10c680c2a39237daa08dd (patch)
tree5ddcc109767250e6f6661e5e87e0527b81c846c1 /source4/scripting
parentb806b69d198c0a95386695d2cc902f7a5005bd72 (diff)
downloadsamba-99e41a377e7b4c64a0a10c680c2a39237daa08dd.tar.gz
errors: fix "generate python error codes for NTSTATUS"
Fixups according to feedback on the list. Signed-off-by: Bob Campbell <bobcampbell@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'source4/scripting')
-rwxr-xr-xsource4/scripting/bin/gen_ntstatus.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/source4/scripting/bin/gen_ntstatus.py b/source4/scripting/bin/gen_ntstatus.py
index dd0c3263274..4738177aa98 100755
--- a/source4/scripting/bin/gen_ntstatus.py
+++ b/source4/scripting/bin/gen_ntstatus.py
@@ -186,8 +186,9 @@ def generatePythonFile(out_file):
out_file.write("\tm = Py_InitModule3(\"ntstatus\", NULL, \"NTSTATUS error defines\");\n");
out_file.write("\tif (m == NULL)\n");
out_file.write("\t\treturn;\n\n");
- for err in ErrorsToUse:
- line = "\tPyModule_AddObject(m, \"%s\", ndr_PyLong_FromUnsignedLongLong(0x%08x));\n" % (err.err_define, err.err_code)
+ for err in Errors:
+ line = """\tPyModule_AddObject(m, \"%s\",
+ \t\tndr_PyLong_FromUnsignedLongLong(NT_STATUS_V(%s)));\n""" % (err.err_define, err.err_define)
out_file.write(line)
out_file.write("}\n");
@@ -253,23 +254,24 @@ def main ():
sys.exit()
# read in the data
- file_contents = open(input_file1,"r")
+ file_contents = open(input_file1, "r")
parseHeaderFile(file_contents)
- file_contents = open(input_file2,"r")
+ file_contents = open(input_file2, "r")
parseErrorDescriptions(file_contents, False)
- file_contents = open(input_file3,"r")
+ file_contents = open(input_file3, "r")
has_already_desc = file_contents.readlines()
processErrorDescription(has_already_desc)
- print "writing new headerfile: %s"%headerfile_name
- out_file = open(headerfile_name,"w")
+
+ print "writing new headerfile: %s" % headerfile_name
+ out_file = open(gen_headerfile_name, "w")
generateHeaderFile(out_file)
out_file.close()
- print "writing new headerfile: %s"%sourcefile_name
- out_file = open(sourcefile_name,"w")
+ print "writing new headerfile: %s" % sourcefile_name
+ out_file = open(sourcefile_name, "w")
generateSourceFile(out_file)
out_file.close()
- print "writing new headerfile: %s"%pythonfile_name
- out_file = open(pythonfile_name,"w")
+ print "writing new headerfile: %s" % pythonfile_name
+ out_file = open(pythonfile_name, "w")
generatePythonFile(out_file)
out_file.close()