1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-29 15:42:04 +03:00

samba-tool: Improve getopt.py error handling

Raise exception when -d or --debuglevel value is <0
This commit is contained in:
Giampaolo Lauria
2011-10-17 15:22:01 -04:00
committed by Jelmer Vernooij
parent e1d2b47693
commit 0c342f8986

View File

@ -64,6 +64,9 @@ class SambaOptions(optparse.OptionGroup):
self._configfile = arg
def _set_debuglevel(self, option, opt_str, arg, parser):
if arg < 0:
raise optparse.OptionValueError("invalid %s option value: %s" %
(opt_str, arg))
self._lp.set('debug level', str(arg))
def _set_realm(self, option, opt_str, arg, parser):