The branch, master has been updated via 064d240 s4:samba_spnupdate: do not attempt to parse log level, use parsed value via 92178f0 python/join: do not attempt to parse log level, use parsed value via dd25aa1 python/drs_utils: do not attempt to parse log level, use parsed value via fa56dbf tests/param add a test for LoadParm.log_level via 7ba50a2 s4:param add log_level function to retrieve log level in Python code from e62ff6c unix_msg: Fix unix_dgram_send_queue_init
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 064d24032398c8896da15246be81fdd4b1588e18 Author: Christian Ambach <a...@samba.org> Date: Tue Sep 13 10:49:47 2016 +0200 s4:samba_spnupdate: do not attempt to parse log level, use parsed value The log level parameter can contain debug class specific entries. Do not attempt to parse this as int, but use the values that the debugging system already parsed BUG: https://bugzilla.samba.org/show_bug.cgi?id=9945 Signed-off-by: Christian Ambach <a...@samba.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> Autobuild-User(master): Christian Ambach <a...@samba.org> Autobuild-Date(master): Wed Sep 14 23:15:18 CEST 2016 on sn-devel-144 commit 92178f02bd09277f783eb68b476cfd1452c7f9ef Author: Christian Ambach <a...@samba.org> Date: Tue Sep 13 10:49:47 2016 +0200 python/join: do not attempt to parse log level, use parsed value The log level parameter can contain debug class specific entries. Do not attempt to parse this as int, but use the values that the debugging system already parsed BUG: https://bugzilla.samba.org/show_bug.cgi?id=9945 Signed-off-by: Christian Ambach <a...@samba.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit dd25aa129b6d799853312134628402f77b492eab Author: Christian Ambach <a...@samba.org> Date: Tue Sep 13 10:49:47 2016 +0200 python/drs_utils: do not attempt to parse log level, use parsed value The log level parameter can contain debug class specific entries. Do not attempt to parse this as int, but use the values that the debugging system already parsed BUG: https://bugzilla.samba.org/show_bug.cgi?id=9945 Signed-off-by: Christian Ambach <a...@samba.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit fa56dbf6706872c5287eab082bb6ba7b5bd3ccd2 Author: Christian Ambach <a...@samba.org> Date: Tue Sep 13 11:22:38 2016 +0200 tests/param add a test for LoadParm.log_level Signed-off-by: Christian Ambach <a...@samba.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 7ba50a200924119ac1a66759e4c1419ece03ba41 Author: Christian Ambach <a...@samba.org> Date: Tue Sep 13 10:48:03 2016 +0200 s4:param add log_level function to retrieve log level in Python code Signed-off-by: Christian Ambach <a...@samba.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> ----------------------------------------------------------------------- Summary of changes: python/samba/drs_utils.py | 2 +- python/samba/join.py | 4 ++-- python/samba/tests/param.py | 6 ++++++ source4/param/pyparam.c | 9 +++++++++ source4/scripting/bin/samba_spnupdate | 2 +- 5 files changed, 19 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/python/samba/drs_utils.py b/python/samba/drs_utils.py index 6c8afae..07fc05a 100644 --- a/python/samba/drs_utils.py +++ b/python/samba/drs_utils.py @@ -44,7 +44,7 @@ def drsuapi_connect(server, lp, creds): """ binding_options = "seal" - if int(lp.get("log level")) >= 5: + if lp.log_level() >= 5: binding_options += ",print" binding_string = "ncacn_ip_tcp:%s[%s]" % (server, binding_options) try: diff --git a/python/samba/join.py b/python/samba/join.py index d1a1b08..a50a409 100644 --- a/python/samba/join.py +++ b/python/samba/join.py @@ -402,7 +402,7 @@ class dc_join(object): def drsuapi_connect(ctx): '''make a DRSUAPI connection to the naming master''' binding_options = "seal" - if int(ctx.lp.get("log level")) >= 4: + if ctx.lp.log_level() >= 4: binding_options += ",print" binding_string = "ncacn_ip_tcp:%s[%s]" % (ctx.server, binding_options) ctx.drsuapi = drsuapi.drsuapi(binding_string, ctx.lp, ctx.creds) @@ -868,7 +868,7 @@ class dc_join(object): repl_creds = ctx.creds binding_options = "seal" - if int(ctx.lp.get("log level")) >= 5: + if ctx.lp.log_level() >= 5: binding_options += ",print" repl = drs_utils.drs_Replicate( "ncacn_ip_tcp:%s[%s]" % (ctx.server, binding_options), diff --git a/python/samba/tests/param.py b/python/samba/tests/param.py index f539eba..684c17c 100644 --- a/python/samba/tests/param.py +++ b/python/samba/tests/param.py @@ -55,3 +55,9 @@ class LoadParmTestCase(samba.tests.TestCase): samba_lp = param.LoadParm() samba_lp.load_default() self.assertRaises(KeyError, samba_lp.__getitem__, "nonexistent") + + def test_log_level(self): + samba_lp = param.LoadParm() + samba_lp.set("log level", "5 auth:4") + self.assertEquals(5, samba_lp.log_level()) + diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c index 6a55999..60c4645 100644 --- a/source4/param/pyparam.c +++ b/source4/param/pyparam.c @@ -322,6 +322,13 @@ static PyObject *py_lp_dump_a_parameter(PyObject *self, PyObject *args) } +static PyObject *py_lp_log_level(PyObject *self, PyObject *unused) +{ + int ret = DEBUGLEVEL_CLASS[DBGC_CLASS]; + return PyInt_FromLong(ret); +} + + static PyObject *py_samdb_url(PyObject *self, PyObject *unused) { struct loadparm_context *lp_ctx = PyLoadparmContext_AsLoadparmContext(self); @@ -357,6 +364,8 @@ static PyMethodDef py_lp_ctx_methods[] = { "Get the server role." }, { "dump", py_lp_dump, METH_VARARGS, "S.dump(stream, show_defaults=False)" }, + { "log_level", py_lp_log_level, METH_NOARGS, + "S.log_level() -> int\n Get the active log level" }, { "dump_a_parameter", py_lp_dump_a_parameter, METH_VARARGS, "S.dump_a_parameter(stream, name, service_name)" }, { "samdb_url", py_samdb_url, METH_NOARGS, diff --git a/source4/scripting/bin/samba_spnupdate b/source4/scripting/bin/samba_spnupdate index 977de68..c83e575 100755 --- a/source4/scripting/bin/samba_spnupdate +++ b/source4/scripting/bin/samba_spnupdate @@ -219,7 +219,7 @@ def call_rodc_update(d): server = cldap_ret.pdc_dns_name try: binding_options = "seal" - if int(lp.get("log level")) >= 5: + if lp.log_level() >= 5: binding_options += ",print" drs = drsuapi.drsuapi('ncacn_ip_tcp:%s[%s]' % (server, binding_options), lp, creds) (drs_handle, supported_extensions) = drs_utils.drs_DsBind(drs) -- Samba Shared Repository