mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Merge pull request #19355 from rallytime/bp-19247
Backport #19247 to 2014.7
This commit is contained in:
commit
2775737859
@ -437,23 +437,21 @@ class Compiler(object):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
chunk_order = chunk['order']
|
chunk_order = chunk['order']
|
||||||
if 'name_order' in chunk:
|
|
||||||
chunk_order = chunk_order + chunk['name_order']
|
|
||||||
|
|
||||||
if chunk_order > cap - 1 and chunk_order > 0:
|
if chunk_order > cap - 1 and chunk_order > 0:
|
||||||
cap = chunk_order + 100
|
cap = chunk_order + 100
|
||||||
for chunk in chunks:
|
for chunk in chunks:
|
||||||
if 'order' not in chunk:
|
if 'order' not in chunk:
|
||||||
chunk['order'] = cap
|
chunk['order'] = cap
|
||||||
else:
|
continue
|
||||||
if isinstance(chunk['order'], int) and 'name_order' in chunk:
|
|
||||||
chunk['order'] = chunk['order'] + chunk.pop('name_order')
|
if not isinstance(chunk['order'], (int, float)):
|
||||||
if not isinstance(chunk['order'], int):
|
|
||||||
if chunk['order'] == 'last':
|
if chunk['order'] == 'last':
|
||||||
chunk['order'] = cap + 1000000
|
chunk['order'] = cap + 1000000
|
||||||
else:
|
else:
|
||||||
chunk['order'] = cap
|
chunk['order'] = cap
|
||||||
elif isinstance(chunk['order'], int) and chunk['order'] < 0:
|
if 'name_order' in chunk:
|
||||||
|
chunk['order'] = chunk['order'] + chunk.pop('name_order') / 10000.0
|
||||||
|
if chunk['order'] < 0:
|
||||||
chunk['order'] = cap + 1000000 + chunk['order']
|
chunk['order'] = cap + 1000000 + chunk['order']
|
||||||
chunks.sort(key=lambda chunk: (chunk['order'], '{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
|
return chunks
|
||||||
@ -1034,25 +1032,23 @@ class State(object):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
chunk_order = chunk['order']
|
chunk_order = chunk['order']
|
||||||
if 'name_order' in chunk:
|
|
||||||
chunk_order = chunk_order + chunk['name_order']
|
|
||||||
|
|
||||||
if chunk_order > cap - 1 and chunk_order > 0:
|
if chunk_order > cap - 1 and chunk_order > 0:
|
||||||
cap = chunk_order + 100
|
cap = chunk_order + 100
|
||||||
for chunk in chunks:
|
for chunk in chunks:
|
||||||
if 'order' not in chunk:
|
if 'order' not in chunk:
|
||||||
chunk['order'] = cap
|
chunk['order'] = cap
|
||||||
else:
|
continue
|
||||||
if isinstance(chunk['order'], int) and 'name_order' in chunk:
|
|
||||||
chunk['order'] = chunk['order'] + chunk.pop('name_order')
|
if not isinstance(chunk['order'], (int, float)):
|
||||||
if not isinstance(chunk['order'], int):
|
|
||||||
if chunk['order'] == 'last':
|
if chunk['order'] == 'last':
|
||||||
chunk['order'] = cap + 1000000
|
chunk['order'] = cap + 1000000
|
||||||
else:
|
else:
|
||||||
chunk['order'] = cap
|
chunk['order'] = cap
|
||||||
elif isinstance(chunk['order'], int) and chunk['order'] < 0:
|
if 'name_order' in chunk:
|
||||||
|
chunk['order'] = chunk['order'] + chunk.pop('name_order') / 10000.0
|
||||||
|
if chunk['order'] < 0:
|
||||||
chunk['order'] = cap + 1000000 + chunk['order']
|
chunk['order'] = cap + 1000000 + chunk['order']
|
||||||
chunks.sort(key=lambda k: (k['order'], '{0[state]}{0[name]}{0[fun]}'.format(k)))
|
chunks.sort(key=lambda chunk: (chunk['order'], '{0[state]}{0[name]}{0[fun]}'.format(chunk)))
|
||||||
return chunks
|
return chunks
|
||||||
|
|
||||||
def compile_high_data(self, high):
|
def compile_high_data(self, high):
|
||||||
|
Loading…
Reference in New Issue
Block a user