mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
config: decode id to unicode
This commit is contained in:
parent
1c6c394d0e
commit
7a16f1c941
1 changed files with 5 additions and 1 deletions
|
@ -38,6 +38,7 @@ import salt.utils.validate.path
|
|||
import salt.utils.xdg
|
||||
import salt.exceptions
|
||||
import salt.utils.sdb
|
||||
from salt.utils.locales import sdecode
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
@ -1411,7 +1412,10 @@ def _read_conf_file(path):
|
|||
conf_opts = {}
|
||||
# allow using numeric ids: convert int to string
|
||||
if 'id' in conf_opts:
|
||||
conf_opts['id'] = str(conf_opts['id'])
|
||||
if not isinstance(conf_opts['id'], six.string_types):
|
||||
conf_opts['id'] = str(conf_opts['id'])
|
||||
else:
|
||||
conf_opts['id'] = sdecode(conf_opts['id'])
|
||||
for key, value in six.iteritems(conf_opts.copy()):
|
||||
if isinstance(value, text_type) and six.PY2:
|
||||
# We do not want unicode settings
|
||||
|
|
Loading…
Add table
Reference in a new issue