Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes to state.py in 2015.8 #30978

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions salt/modules/state.py
Expand Up @@ -70,6 +70,10 @@ def _set_retcode(ret):
'''
Set the return code based on the data back from the state system
'''

# Set default retcode to 0
__context__['retcode'] = 0

if isinstance(ret, list):
__context__['retcode'] = 1
return
Expand Down Expand Up @@ -576,7 +580,6 @@ def highstate(test=None,

serial = salt.payload.Serial(__opts__)
cache_file = os.path.join(__opts__['cachedir'], 'highstate.p')

_set_retcode(ret)
# Work around Windows multiprocessing bug, set __opts__['test'] back to
# value from before this function was run.
Expand Down Expand Up @@ -770,7 +773,6 @@ def sls(mods,
except (IOError, OSError):
msg = 'Unable to write to SLS cache file {0}. Check permission.'
log.error(msg.format(cache_file))

_set_retcode(ret)
# Work around Windows multiprocessing bug, set __opts__['test'] back to
# value from before this function was run.
Expand Down Expand Up @@ -876,8 +878,7 @@ def show_highstate(queue=False, **kwargs):
ret = st_.compile_highstate()
finally:
st_.pop_active()
if isinstance(ret, list):
__context__['retcode'] = 1
_set_retcode(ret)
return ret


Expand Down