mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
salt/state.py: set chunk['order'] = 0' with
order: first'; fixes #24744
Currently the `order: first' keyword executes later states without order options. Consider a test case such as: ```SaltStack sleep 1: cmd.run: - order: first sleep 2: cmd.run sleep 3: cmd.run sleep 4: cmd.run: - order: last ``` The contents of each chunk dictionary at runtime show that the 'first' state is not evaluated to 'first'. {'name': 'sleep 4', 'state': 'cmd', '__id__': 'sleep 4', 'fun': 'run', '__env__': 'base', '__sls__': u'test', 'order': 1010100} {'name': 'sleep 2', 'state': 'cmd', '__id__': 'sleep 2', 'fun': 'run', '__env__': 'base', '__sls__': u'test', 'order': 10000} {'name': 'sleep 3', 'state': 'cmd', '__id__': 'sleep 3', 'fun': 'run', '__env__': 'base', '__sls__': u'test', 'order': 10001} {'name': 'sleep 1', 'state': 'cmd', '__id__': 'sleep 1', 'fun': 'run', '__env__': 'base', '__sls__': u'test', 'order': 10100}
This commit is contained in:
parent
58021035a9
commit
64c850410f
@ -512,6 +512,8 @@ class Compiler(object):
|
||||
if not isinstance(chunk['order'], (int, float)):
|
||||
if chunk['order'] == 'last':
|
||||
chunk['order'] = cap + 1000000
|
||||
elif chunk['order'] == 'first':
|
||||
chunk['order'] = 0
|
||||
else:
|
||||
chunk['order'] = cap
|
||||
if 'name_order' in chunk:
|
||||
@ -1140,6 +1142,8 @@ class State(object):
|
||||
if not isinstance(chunk['order'], (int, float)):
|
||||
if chunk['order'] == 'last':
|
||||
chunk['order'] = cap + 1000000
|
||||
elif chunk['order'] == 'first':
|
||||
chunk['order'] = 0
|
||||
else:
|
||||
chunk['order'] = cap
|
||||
if 'name_order' in chunk:
|
||||
|
Loading…
Reference in New Issue
Block a user