]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python: netcmd: SUPPRESS_HELP constant has no effect here
authorRob van der Linde <rob@catalyst.net.nz>
Thu, 5 Oct 2023 02:18:32 +0000 (15:18 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 24 Oct 2023 23:31:29 +0000 (23:31 +0000)
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 <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/__init__.py
python/samba/netcmd/dbcheck.py
python/samba/netcmd/ntacl.py

index a1c070b618cb665ad37e0591bc5e7338d2c28098..fea3ad2d660d2bf45f5fd4f2918320273597e7f2 100644 (file)
@@ -34,7 +34,7 @@ from .encoders import JSONEncoder
 
 
 class Option(SambaOption):
-    SUPPRESS_HELP = optparse.SUPPRESS_HELP
+    pass
 
 
 class PlainHelpFormatter(optparse.IndentedHelpFormatter):
index 78a32c33537d155c20bdbe7b77db2d2daf3f07f8..657881b5eea120a99b9a97494d732fbea5555111 100644 (file)
@@ -16,6 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
+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,
index bc0b26eb689023b24f585cf098564e6b4d8a457a..022de076cbad92930f3fdcc07241da24783825b4 100644 (file)
@@ -16,6 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
+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"]),