mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Add function to state module to return the low chunks
This commit is contained in:
parent
d5ad2f5b95
commit
abba0181c0
@ -62,3 +62,13 @@ def highstate():
|
||||
'''
|
||||
st_ = salt.state.HighState(__opts__)
|
||||
return st_.call_highstate()
|
||||
|
||||
def show_lowstate():
|
||||
'''
|
||||
List out the low data that will be applied to this minion
|
||||
|
||||
CLI Example:
|
||||
salt '*' show_lowstate
|
||||
'''
|
||||
st_ = salt.state.HighState(__opts__)
|
||||
return st_.compile_low_chunks()
|
||||
|
@ -463,7 +463,6 @@ class State(object):
|
||||
Process a high data call and ensure the defined states.
|
||||
'''
|
||||
err = []
|
||||
rets = []
|
||||
# Verify that the high data is structurally sound
|
||||
errors = self.verify_high(high)
|
||||
if errors:
|
||||
@ -649,3 +648,24 @@ class HighState(object):
|
||||
if errors:
|
||||
return errors
|
||||
return self.state.call_high(high)
|
||||
|
||||
def compile_low_chunks(self):
|
||||
'''
|
||||
Compile the highstate but don't run it, return the low chunks to see
|
||||
exactly what the highstate will execute
|
||||
'''
|
||||
err = []
|
||||
top = self.get_top()
|
||||
matches = self.top_matches(top)
|
||||
high, errors = self.render_highstate(matches)
|
||||
# Verify that the high data is structurally sound
|
||||
errors = self.state.verify_high(high)
|
||||
# If there is extension data reconcile it
|
||||
high, ext_errors = self.state.reconcile_extend(high)
|
||||
errors += ext_errors
|
||||
# Compile and verify the raw chunks
|
||||
chunks = self.state.compile_high_data(high)
|
||||
errors += self.state.verify_chunks(chunks)
|
||||
if errors:
|
||||
return errors
|
||||
return chunks
|
||||
|
Loading…
Reference in New Issue
Block a user