summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2011-10-19 01:30:40 +0200
committerJelmer Vernooij <jelmer@samba.org>2011-10-19 03:34:07 +0200
commitaa7240e6cf9d2fcec660116f891fc9c7d6ce39bc (patch)
tree62c1e18a7dfa3f0ed940a2b7aad361ec85a66af8 /source4
parenteb388cddacb42ae30f4ebb2fc846982132d3ad06 (diff)
downloadsamba-aa7240e6cf9d2fcec660116f891fc9c7d6ce39bc.tar.gz
samba-aa7240e6cf9d2fcec660116f891fc9c7d6ce39bc.tar.bz2
samba-aa7240e6cf9d2fcec660116f891fc9c7d6ce39bc.zip
samba.getopt: Keep exception message when setting a lp option fails.
Diffstat (limited to 'source4')
-rw-r--r--source4/scripting/python/samba/getopt.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/source4/scripting/python/samba/getopt.py b/source4/scripting/python/samba/getopt.py
index 68a2cc72f8..8a9d4e5622 100644
--- 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:
- 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])
- 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."""