diff --git a/salt/output/highstate.py b/salt/output/highstate.py index 1ec626f14b22..c212c20cd63d 100644 --- a/salt/output/highstate.py +++ b/salt/output/highstate.py @@ -69,7 +69,6 @@ # Import salt libs import salt.utils -import salt.utils.locales import salt.output from salt.utils.locales import sdecode @@ -87,6 +86,8 @@ def output(data): def _format_host(host, data): + host = sdecode(host) + colors = salt.utils.get_colors( __opts__.get('color'), __opts__.get('color_theme')) @@ -157,7 +158,7 @@ def _format_host(host, data): if ret['result'] is None: hcolor = colors['LIGHT_YELLOW'] tcolor = colors['LIGHT_YELLOW'] - comps = tname.split('_|-') + comps = [sdecode(comp) for comp in tname.split('_|-')] if __opts__.get('state_output', 'full').lower() == 'filter': # By default, full data is shown for all types. However, return # data may be excluded by setting state_output_exclude to a @@ -234,7 +235,7 @@ def _format_host(host, data): # but try to continue on errors pass try: - comment = salt.utils.locales.sdecode(ret['comment']) + comment = sdecode(ret['comment']) comment = comment.strip().replace( u'\n', u'\n' + u' ' * 14) @@ -267,7 +268,7 @@ def _format_host(host, data): 'tcolor': tcolor, 'comps': comps, 'ret': ret, - 'comment': comment, + 'comment': sdecode(comment), # This nukes any trailing \n and indents the others. 'colors': colors } diff --git a/salt/state.py b/salt/state.py index e3b2a9bb7de9..1dec60b4ec6a 100644 --- a/salt/state.py +++ b/salt/state.py @@ -37,6 +37,7 @@ from salt.template import compile_template, compile_template_str from salt.exceptions import SaltRenderError, SaltReqTimeoutError, SaltException from salt.utils.odict import OrderedDict, DefaultOrderedDict +from salt.utils.locales import sdecode # Import third party libs # pylint: disable=import-error,no-name-in-module,redefined-builtin @@ -494,6 +495,7 @@ def order_chunks(self, chunks): chunk['order'] = chunk['order'] + chunk.pop('name_order') / 10000.0 if chunk['order'] < 0: chunk['order'] = cap + 1000000 + chunk['order'] + chunk['name'] = sdecode(chunk['name']) chunks.sort(key=lambda chunk: (chunk['order'], '{0[state]}{0[name]}{0[fun]}'.format(chunk))) return chunks diff --git a/salt/states/file.py b/salt/states/file.py index 670dfef3366b..58cb12df2ad6 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -252,6 +252,7 @@ def run(): import salt.utils import salt.utils.templates import salt.utils.url +from salt.utils.locales import sdecode from salt.exceptions import CommandExecutionError from salt.serializers import yaml as yaml_serializer from salt.serializers import json as json_serializer @@ -2082,7 +2083,7 @@ def recurse(name, recursively removed so that symlink creation can proceed. This option is usually not needed except in special circumstances. ''' - name = os.path.expanduser(name) + name = os.path.expanduser(sdecode(name)) user = _test_owner(kwargs, user=user) if salt.utils.is_windows(): @@ -2319,7 +2320,7 @@ def process_symlinks(filenames, symlinks): # the file to copy from; it is either a normal file or an # empty dir(if include_empty==true). - relname = os.path.relpath(fn_, srcpath) + relname = sdecode(os.path.relpath(fn_, srcpath)) if relname.startswith('..'): continue