mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
salt.fileserver.Fileserver: Don't try to split a list in _gen_back
This fixes a bug which causes backends passed as a python list to be converted to a ``str`` (specifically a ``unicode`` type in PY2) and then split, resulting in a backend that will never match anything. This only affects runner and Salt Python API usage in which the "backend" param to fileserver runner funcs is passed as a Python list.
This commit is contained in:
parent
4e9490eebe
commit
363b21fd9b
1 changed files with 5 additions and 4 deletions
|
@ -323,10 +323,11 @@ class Fileserver(object):
|
|||
if not back:
|
||||
back = self.opts['fileserver_backend']
|
||||
else:
|
||||
try:
|
||||
back = back.split(',')
|
||||
except AttributeError:
|
||||
back = six.text_type(back).split(',')
|
||||
if not isinstance(back, list):
|
||||
try:
|
||||
back = back.split(',')
|
||||
except AttributeError:
|
||||
back = six.text_type(back).split(',')
|
||||
|
||||
ret = []
|
||||
if not isinstance(back, list):
|
||||
|
|
Loading…
Add table
Reference in a new issue