git.samba.org
/
obnox
/
samba
/
samba-obnox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e1d2b47
)
samba-tool: Improve getopt.py error handling
author
Giampaolo Lauria
<lauria2@yahoo.com>
Mon, 17 Oct 2011 19:22:01 +0000
(15:22 -0400)
committer
Jelmer Vernooij
<jelmer@samba.org>
Wed, 19 Oct 2011 01:34:07 +0000
(
03:34
+0200)
Raise exception when -d or --debuglevel value is <0
source4/scripting/python/samba/getopt.py
patch
|
blob
|
history
diff --git
a/source4/scripting/python/samba/getopt.py
b/source4/scripting/python/samba/getopt.py
index f939180066ffbc422ce9f9753ad6269a62d83c19..c7035c1936554a63195465fa5c6d95aebf934d56 100644
(file)
--- a/
source4/scripting/python/samba/getopt.py
+++ b/
source4/scripting/python/samba/getopt.py
@@
-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):