From: Rob van der Linde Date: Thu, 5 Oct 2023 02:18:32 +0000 (+1300) Subject: python: netcmd: SUPPRESS_HELP constant has no effect here X-Git-Tag: talloc-2.4.2~1135 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=32032937ed905d5f5b9ac8ba94381e7cb03f443c;p=thirdparty%2Fsamba.git python: netcmd: SUPPRESS_HELP constant has no effect here Where it is used, on a few options, the constant should be used directly instead. This means that in the following commit, the Option subclass of SambaOption can be removed, as it will become redundant. Signed-off-by: Rob van der Linde Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/netcmd/__init__.py b/python/samba/netcmd/__init__.py index a1c070b618c..fea3ad2d660 100644 --- a/python/samba/netcmd/__init__.py +++ b/python/samba/netcmd/__init__.py @@ -34,7 +34,7 @@ from .encoders import JSONEncoder class Option(SambaOption): - SUPPRESS_HELP = optparse.SUPPRESS_HELP + pass class PlainHelpFormatter(optparse.IndentedHelpFormatter): diff --git a/python/samba/netcmd/dbcheck.py b/python/samba/netcmd/dbcheck.py index 78a32c33537..657881b5eea 100644 --- a/python/samba/netcmd/dbcheck.py +++ b/python/samba/netcmd/dbcheck.py @@ -16,6 +16,7 @@ # along with this program. If not, see . # +import optparse import sys import ldb @@ -84,7 +85,7 @@ class cmd_dbcheck(Command): type=str, metavar="URL", dest="H"), Option("--selftest-check-expired-tombstones", dest="selftest_check_expired_tombstones", default=False, action="store_true", - help=Option.SUPPRESS_HELP), # This is only used by tests + help=optparse.SUPPRESS_HELP), # This is only used by tests ] def run(self, DN=None, H=None, verbose=False, fix=False, yes=False, diff --git a/python/samba/netcmd/ntacl.py b/python/samba/netcmd/ntacl.py index bc0b26eb689..022de076cba 100644 --- a/python/samba/netcmd/ntacl.py +++ b/python/samba/netcmd/ntacl.py @@ -16,6 +16,7 @@ # along with this program. If not, see . # +import optparse import os import samba.getopt as options @@ -75,7 +76,7 @@ class cmd_ntacl_set(Command): takes_options = [ # --quiet is not used at all... - Option("-q", "--quiet", help=Option.SUPPRESS_HELP, action="store_true"), + Option("-q", "--quiet", help=optparse.SUPPRESS_HELP, action="store_true"), Option("-v", "--verbose", help="Be verbose", action="store_true"), Option("--xattr-backend", type="choice", help="xattr backend type (native fs or tdb)", choices=["native", "tdb"]),