From 668cc39e320aeb30641580a1fcab39c108bd9c26 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 7 Sep 2017 11:26:04 +1200 Subject: python: Allow debug classes to be specified on the command line for python tools Signed-off-by: Andrew Bartlett Reviewed-by: Douglas Bagnall BUG: https://bugzilla.samba.org/show_bug.cgi?id=13017 Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Thu Sep 7 10:43:33 CEST 2017 on sn-devel-144 (cherry picked from commit c938f61d332de0323cb135b201367f90f08d76a8) --- python/samba/getopt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'python') diff --git a/python/samba/getopt.py b/python/samba/getopt.py index 9e1fb83167a..f166469e77f 100644 --- a/python/samba/getopt.py +++ b/python/samba/getopt.py @@ -40,7 +40,7 @@ class SambaOptions(optparse.OptionGroup): type=str, metavar="FILE", help="Configuration file", callback=self._load_configfile) self.add_option("-d", "--debuglevel", action="callback", - type=int, metavar="DEBUGLEVEL", help="debug level", + type=str, metavar="DEBUGLEVEL", help="debug level", callback=self._set_debuglevel) self.add_option("--option", action="callback", type=str, metavar="OPTION", @@ -64,8 +64,8 @@ class SambaOptions(optparse.OptionGroup): if arg < 0: raise optparse.OptionValueError("invalid %s option value: %s" % (opt_str, arg)) - self._lp.set('debug level', str(arg)) - parser.values.debuglevel = int(arg) + self._lp.set('debug level', arg) + parser.values.debuglevel = arg def _set_realm(self, option, opt_str, arg, parser): self._lp.set('realm', arg) -- cgit v1.2.1