mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Don't expect any ordering from sets!!!!!
This commit is contained in:
parent
08eba84cfb
commit
adacf4cc28
@ -566,7 +566,7 @@ class Compiler(object):
|
||||
continue
|
||||
for state, run in six.iteritems(body):
|
||||
funcs = set()
|
||||
names = set()
|
||||
names = []
|
||||
if state.startswith('__'):
|
||||
continue
|
||||
chunk = {'state': state,
|
||||
@ -583,7 +583,9 @@ class Compiler(object):
|
||||
if isinstance(arg, dict):
|
||||
for key, val in six.iteritems(arg):
|
||||
if key == 'names':
|
||||
names.update(val)
|
||||
for _name in val:
|
||||
if _name not in names:
|
||||
names.append(_name)
|
||||
continue
|
||||
else:
|
||||
chunk.update(arg)
|
||||
@ -1266,7 +1268,7 @@ class State(object):
|
||||
continue
|
||||
for state, run in six.iteritems(body):
|
||||
funcs = set()
|
||||
names = set()
|
||||
names = []
|
||||
if state.startswith('__'):
|
||||
continue
|
||||
chunk = {'state': state,
|
||||
@ -1285,7 +1287,9 @@ class State(object):
|
||||
if isinstance(arg, dict):
|
||||
for key, val in six.iteritems(arg):
|
||||
if key == 'names':
|
||||
names.update(val)
|
||||
for _name in val:
|
||||
if _name not in names:
|
||||
names.append(_name)
|
||||
elif key == 'state':
|
||||
# Don't pass down a state override
|
||||
continue
|
||||
|
@ -1,9 +1,9 @@
|
||||
handle-iorder:
|
||||
cmd:
|
||||
- cwd: /tmp/ruby-1.9.2-p320
|
||||
- names:
|
||||
- ./configure
|
||||
- make
|
||||
- make install
|
||||
- run
|
||||
- cwd: /tmp/ruby-1.9.2-p320
|
||||
- names:
|
||||
- ./configure
|
||||
- make
|
||||
- make install
|
||||
- run
|
||||
|
||||
|
@ -20,8 +20,7 @@ class HandleOrderTest(integration.ModuleCase):
|
||||
'''
|
||||
ret = self.run_function('state.show_low_sls', mods='issue-7649-handle-iorder')
|
||||
|
||||
sorted_chunks = sorted(ret, key=lambda c: c.get('order'))
|
||||
sorted_chunks = [chunk['name'] for chunk in sorted(ret, key=lambda c: c.get('order'))]
|
||||
|
||||
self.assertEqual(sorted_chunks[0]['name'], './configure')
|
||||
self.assertEqual(sorted_chunks[1]['name'], 'make')
|
||||
self.assertEqual(sorted_chunks[2]['name'], 'make install')
|
||||
expected = ['./configure', 'make', 'make install']
|
||||
self.assertEqual(expected, sorted_chunks)
|
||||
|
Loading…
Reference in New Issue
Block a user