]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
samba-tool: add a convenience function that does it all
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 7 Sep 2022 22:00:36 +0000 (10:00 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 8 Sep 2022 22:34:36 +0000 (22:34 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/main.py

index 88c33c5aa1a1e18306f50f3e02dfde05c70b8284..0565aff5406ef4abb450c15d79e9ac080eeb87ba 100644 (file)
@@ -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)