mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #30675 from jfindlay/decode_id
handle non-ascii minion IDs
This commit is contained in:
commit
4008e1719a
2 changed files with 8 additions and 4 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
|
||||
|
|
|
@ -10,6 +10,7 @@ from __future__ import absolute_import
|
|||
# Import salt libs
|
||||
import salt.utils
|
||||
import salt.output
|
||||
from salt.utils.locales import sdecode
|
||||
|
||||
|
||||
def output(data):
|
||||
|
@ -88,9 +89,8 @@ def output(data):
|
|||
for status in sorted(data):
|
||||
ret += u'{0}\n'.format(trans[status])
|
||||
for key in sorted(data[status]):
|
||||
skey = key
|
||||
if strip_colors:
|
||||
skey = salt.output.strip_esc_sequence(key)
|
||||
key = sdecode(key)
|
||||
skey = salt.output.strip_esc_sequence(key) if strip_colors else key
|
||||
if isinstance(data[status], list):
|
||||
ret += u'{0}{1}{2}{3}\n'.format(
|
||||
' ' * ident,
|
||||
|
|
Loading…
Add table
Reference in a new issue