Fix multi-sls salt.state orchestration in masterless systems

When `salt.state` orchestration on masterless systems was introduced (in
8e3abb11), only the single-string in `sls` case was supported:

```yaml
<name>:
  salt.state:
    - sls: '...'
```

The documentation for `salt.state` says multiple sls files can be supplied in a
list:

```yaml
<name>:
  salt.state:
    - sls:
      - ...
      - ...
      - ...
```

But with masterless orchestration, this does not work because the original
patch passes a list containing a joined string of comma-separated sls files
instead of the joined string itself.

This takes care of that case too by passing joined string, since `state.sls`
handles comma-separated joined string just fine.
This commit is contained in:
Pritam Baral 2018-06-29 20:34:12 +05:30
parent b88ec5258d
commit adcee28b84
No known key found for this signature in database
GPG key ID: B72CAA8980F46562

View file

@ -335,7 +335,7 @@ def state(name,
if top:
cmd_kw['topfn'] = ''.join(cmd_kw.pop('arg'))
elif sls:
cmd_kw['mods'] = cmd_kw.pop('arg')
cmd_kw['mods'] = ''.join(cmd_kw.pop('arg'))
cmd_kw.update(cmd_kw.pop('kwarg'))
tmp_ret = __salt__[fun](**cmd_kw)
cmd_ret = {__opts__['id']: {