Revert "Track down more unicode instances and add a test"

This reverts commit 9729aed262.

This isn't the right approach here. This fix needs to be more narrow.
This commit is contained in:
rallytime 2016-06-01 16:44:05 -04:00
parent 9729aed262
commit e68097445c
3 changed files with 9 additions and 19 deletions

View file

@ -134,7 +134,7 @@ def _gen_tag(low):
'''
Generate the running dict tag string from the low data structure
'''
return u'{0[state]}_|-{0[__id__]}_|-{0[name]}_|-{0[fun]}'.format(low)
return '{0[state]}_|-{0[__id__]}_|-{0[name]}_|-{0[fun]}'.format(low)
def _l_tag(name, id_):
@ -1221,7 +1221,7 @@ class State(object):
chunk['order'] = chunk['order'] + chunk.pop('name_order') / 10000.0
if chunk['order'] < 0:
chunk['order'] = cap + 1000000 + chunk['order']
chunks.sort(key=lambda chunk: (chunk['order'], u'{0[state]}{0[name]}{0[fun]}'.format(chunk)))
chunks.sort(key=lambda chunk: (chunk['order'], '{0[state]}{0[name]}{0[fun]}'.format(chunk)))
return chunks
def compile_high_data(self, high):
@ -1610,7 +1610,7 @@ class State(object):
before processing.
'''
start_time = datetime.datetime.now()
log.info(u'Running state [{0}] at time {1}'.format(low['name'], start_time.time().isoformat()))
log.info('Running state [{0}] at time {1}'.format(low['name'], start_time.time().isoformat()))
errors = self.verify_data(low)
if errors:
ret = {
@ -1630,8 +1630,11 @@ class State(object):
ret = {'result': False, 'name': low['name'], 'changes': {}}
if not low.get('__prereq__'):
log.info(u'Executing state {0[state]}.{0[fun]} '
u'for {0[name]}'.format(low))
log.info(
'Executing state {0[state]}.{0[fun]} for {0[name]}'.format(
low
)
)
if 'provider' in low:
self.load_modules(low)
@ -1748,9 +1751,7 @@ class State(object):
duration = (delta.seconds * 1000000 + delta.microseconds)/1000.0
ret['duration'] = duration
ret['__id__'] = low['__id__']
log.info(u'Completed state [{0}] at time {1} duration_in_ms={2}'.format(low['name'],
finish_time.time().isoformat(),
duration))
log.info('Completed state [{0}] at time {1} duration_in_ms={2}'.format(low['name'], finish_time.time().isoformat(), duration))
return ret
def call_chunks(self, chunks):

View file

@ -1,2 +0,0 @@
Français:
pkg.installed

View file

@ -343,15 +343,6 @@ class PkgTest(integration.ModuleCase,
ret = self.run_function('pkg.info_installed', [package])
self.assertTrue(pkgquery in str(ret))
def test_pkg_non_ascii_name(self):
'''
Tests that a pkg.installed state will run to completion, even
if the return is False, without choking on a UnicodeEncodeError
somwhere along the line.
'''
ret = self.run_function('state.sls', mods='non-ascii-pkg-name')
self.assertSaltFalseReturn(ret)
if __name__ == '__main__':
from integration import run_tests
run_tests(PkgTest)