From: Douglas Bagnall Date: Wed, 7 Sep 2022 22:00:36 +0000 (+1200) Subject: samba-tool: add a convenience function that does it all X-Git-Tag: talloc-2.4.0~1124 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5247c87cc2ce756196a1d0354d20327870cb36a4;p=thirdparty%2Fsamba.git samba-tool: add a convenience function that does it all Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/netcmd/main.py b/python/samba/netcmd/main.py index 88c33c5aa1a..0565aff5406 100644 --- a/python/samba/netcmd/main.py +++ b/python/samba/netcmd/main.py @@ -81,3 +81,10 @@ class cmd_sambatool(SuperCommand): subcommands["ou"] = None subcommands["processes"] = None subcommands["visualize"] = None + + +def samba_tool(*args, **kwargs): + """A single function that runs samba-tool, returning an error code on + error, and None on success.""" + cmd, argv = cmd_sambatool()._resolve("samba-tool", *args, **kwargs) + return cmd._run(*argv)