mirror of
https://github.com/samba-team/samba.git
synced 2025-12-12 12:23:50 +03:00
py/getopt: allow --option arguments to contain '='
smb.conf lines can have = on the right hand side. For example, in st/ad_dc/etc/smb.conf we have 3 examples, including: gpo update command = python3 source4/scripting/bin/samba-gpupdate [...] --target=Computer If we tried to provide the same line via --option, it would split on both '=', and the set value would end at '--target'. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Douglas Bagnall
parent
c2178d87c2
commit
1137647460
@@ -84,7 +84,7 @@ class SambaOptions(optparse.OptionGroup):
|
||||
if arg.find('=') == -1:
|
||||
raise optparse.OptionValueError(
|
||||
"--option option takes a 'a=b' argument")
|
||||
a = arg.split('=')
|
||||
a = arg.split('=', 1)
|
||||
try:
|
||||
self._lp.set(a[0], a[1])
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user