mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add salt.utils.split_input()
This commit is contained in:
parent
2ed7286af1
commit
2ad8ceffc2
1 changed files with 12 additions and 0 deletions
|
@ -2874,3 +2874,15 @@ def invalid_kwargs(invalid_kwargs, raise_exc=True):
|
|||
raise SaltInvocationError(msg)
|
||||
else:
|
||||
return msg
|
||||
|
||||
|
||||
def split_input(val):
|
||||
'''
|
||||
Take an input value and split it into a list, returning the resulting list
|
||||
'''
|
||||
if isinstance(val, list):
|
||||
return val
|
||||
try:
|
||||
return val.split(',')
|
||||
except AttributeError:
|
||||
return str(val).split(',')
|
||||
|
|
Loading…
Add table
Reference in a new issue