[RFC PATCH v4] add JSON output to net ads

Andrew Bartlett abartlet at samba.org
Thu Aug 2 02:27:53 UTC 2018

On Fri, 2018-07-13 at 13:54 +0200, Philipp Gesang wrote:
> Hi again,
> attached is the fourth iteration of the JSON patches for “net
> ads” (CI: https://gitlab.com/phgsng/samba/pipelines/25703977).
> Description in lieu of a cover letter:
> -8<----------------------------------------------------------->8-
> Changes in v4:
> * Incorporate feedback by Gary Lockyer.
> * Change signature of json_to_string() too to take const*
>   (necessitated by above item).
> * Submit as patch bundle.

> V1 blurb:
> The informational commands of the ``net ads'' family format their
> output in an ad-hoc manner that is not specified. For automated
> processing it would be useful to optionally encode the output as
> These two patches against master add such a JSON output to ``net
> ads info'' and ``net ads lookup''. They have been forward-ported
> from the 4.7-ish Samba that we run. Compilation succeeds with
> master but I'm still in the process of getting working test
> environment, so they're virtually untested.
> -8<----------------------------------------------------------->8-

Thank you so much Philipp! 

Sorry for the delay in this, there are just two more things I need.

We need a testsuite for this, for example using python, the
samba.tests.BlackboxTestCase class and the self.check_output()

python/samba/tests/blackbox/samba_dnsupdate.py would be a good example,
and then load the output with a the python JSON lib (eg json.loads())

That will ensure we don't start outputting random non-json stuff in
there, and that this keeps working.

Finally, someone else beat you to master and so the patch doesn't
apply.  It doesn't look like major damage after you drop the changes
Gary already merged, but isn't much but we need it rebased.  

Andrew Bartlett

Andrew Bartlett
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT   

More information about the samba-technical mailing list