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:
eb388cd
)
samba.getopt: Keep exception message when setting a lp option fails.
author
Jelmer Vernooij
<jelmer@samba.org>
Tue, 18 Oct 2011 23:30:40 +0000
(
01:30
+0200)
committer
Jelmer Vernooij
<jelmer@samba.org>
Wed, 19 Oct 2011 01:34:07 +0000
(
03:34
+0200)
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 68a2cc72f88086d392c5686ce434f73752a4736c..8a9d4e5622a3bb6876aeb5517b4778b6e72a922f 100644
(file)
--- a/
source4/scripting/python/samba/getopt.py
+++ b/
source4/scripting/python/samba/getopt.py
@@
-75,13
+75,14
@@
class SambaOptions(optparse.OptionGroup):
def _set_option(self, option, opt_str, arg, parser):
if arg.find('=') == -1:
def _set_option(self, option, opt_str, arg, parser):
if arg.find('=') == -1:
- raise optparse.OptionValueError("--option option takes a 'a=b' argument")
+ raise optparse.OptionValueError(
+ "--option option takes a 'a=b' argument")
a = arg.split('=')
try:
self._lp.set(a[0], a[1])
a = arg.split('=')
try:
self._lp.set(a[0], a[1])
- except Exception:
- raise optparse.OptionValueError(
"invalid --option option value: %s"
-
% arg
)
+ except Exception
, e
:
+ raise optparse.OptionValueError(
+
"invalid --option option value %r: %s" % (arg, e)
)
def get_loadparm(self):
"""Return loadparm object with data specified on the command line."""
def get_loadparm(self):
"""Return loadparm object with data specified on the command line."""