mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
python: Allow debug classes to be specified on the command line for python tools
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Sep 7 10:43:33 CEST 2017 on sn-devel-144
This commit is contained in:
@ -40,7 +40,7 @@ class SambaOptions(optparse.OptionGroup):
|
|||||||
type=str, metavar="FILE", help="Configuration file",
|
type=str, metavar="FILE", help="Configuration file",
|
||||||
callback=self._load_configfile)
|
callback=self._load_configfile)
|
||||||
self.add_option("-d", "--debuglevel", action="callback",
|
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)
|
callback=self._set_debuglevel)
|
||||||
self.add_option("--option", action="callback",
|
self.add_option("--option", action="callback",
|
||||||
type=str, metavar="OPTION",
|
type=str, metavar="OPTION",
|
||||||
@ -64,8 +64,8 @@ class SambaOptions(optparse.OptionGroup):
|
|||||||
if arg < 0:
|
if arg < 0:
|
||||||
raise optparse.OptionValueError("invalid %s option value: %s" %
|
raise optparse.OptionValueError("invalid %s option value: %s" %
|
||||||
(opt_str, arg))
|
(opt_str, arg))
|
||||||
self._lp.set('debug level', str(arg))
|
self._lp.set('debug level', arg)
|
||||||
parser.values.debuglevel = int(arg)
|
parser.values.debuglevel = arg
|
||||||
|
|
||||||
def _set_realm(self, option, opt_str, arg, parser):
|
def _set_realm(self, option, opt_str, arg, parser):
|
||||||
self._lp.set('realm', arg)
|
self._lp.set('realm', arg)
|
||||||
|
Reference in New Issue
Block a user