summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/scripting/python/samba/getopt.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/getopt.py b/source4/scripting/python/samba/getopt.py
index 14cfba6241..7f500ec63d 100644
--- a/source4/scripting/python/samba/getopt.py
+++ b/source4/scripting/python/samba/getopt.py
@@ -77,7 +77,11 @@ class SambaOptions(optparse.OptionGroup):
if arg.find('=') == -1:
raise optparse.OptionValueError("--option option takes a 'a=b' argument")
a = arg.split('=')
- self._lp.set(a[0], a[1])
+ try:
+ self._lp.set(a[0], a[1])
+ except Exception:
+ raise optparse.OptionValueError("invalid --option option value: %s"
+ % arg)
def get_loadparm(self):
"""Return loadparm object with data specified on the command line."""