mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Raise exception if more than one opt is passed in the same string arg
This commit is contained in:
parent
6bd0f98062
commit
e616d5b509
@ -5221,10 +5221,16 @@ def grep(path,
|
||||
split_opts = []
|
||||
for opt in opts:
|
||||
try:
|
||||
opt = salt.utils.shlex_split(opt)
|
||||
split = salt.utils.shlex_split(opt)
|
||||
except AttributeError:
|
||||
opt = salt.utils.shlex_split(str(opt))
|
||||
split_opts.extend(opt)
|
||||
split = salt.utils.shlex_split(str(opt))
|
||||
if len(split) > 1:
|
||||
raise SaltInvocationError(
|
||||
'Passing multiple command line arguments in a single string '
|
||||
'is not supported, please pass the following arguments '
|
||||
'separately: {0}'.format(opt)
|
||||
)
|
||||
split_opts.extend(split)
|
||||
|
||||
cmd = ['grep'] + split_opts + [pattern, path]
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user