Salt: [BUG] `list` options will treat strings as lists

Created on 6 Jul 2020  路  1Comment  路  Source: saltstack/salt

Description

This snippet:

https://github.com/saltstack/salt/blob/b95213ec903402f25c1e0aeb3990fe8452ab63ce/salt/config/__init__.py#L1817-L1819

... makes it so that list options, e.g.:

https://github.com/saltstack/salt/blob/b95213ec903402f25c1e0aeb3990fe8452ab63ce/salt/config/__init__.py#L273-L274

... given as strings quietly end up as character lists, e.g. module_dirs: /foo, ends up being used as ['/', 'f', 'o', 'o']. Are there situations where this is desirable? Treating this case as invalid, or maybe converting list options given as strings to one-item lists seems like it would be more expected.

Setup

See above.

Steps to Reproduce the behavior

See above.

Expected behavior

Single strings provided to list options are either converted to one-item lists, or rejected.

Versions Report

v3001.

Additional context

The current behaviour led to a time-consuming Support case.

Aluminium Bug Core ZD phase-plan severity-high status-to-do

Most helpful comment

Removed the loader label since this is related to configuration.

Explicit is better than implicit.
So, salt should just complain about the wrong type of the setting.

>All comments

Removed the loader label since this is related to configuration.

Explicit is better than implicit.
So, salt should just complain about the wrong type of the setting.

Was this page helpful?
0 / 5 - 0 ratings