mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #28514 from basepi/merge-forward-2015.8
[2015.8] Merge forward from 2015.5 to 2015.8
This commit is contained in:
commit
8cbea63e40
@ -700,11 +700,13 @@ def sls(mods,
|
||||
except NameError:
|
||||
st_ = salt.state.HighState(opts, pillar, kwargs.get('__pub_jid'))
|
||||
|
||||
umask = os.umask(0o77)
|
||||
if kwargs.get('cache'):
|
||||
if os.path.isfile(cfn):
|
||||
with salt.utils.fopen(cfn, 'rb') as fp_:
|
||||
high_ = serial.load(fp_)
|
||||
return st_.state.call_high(high_)
|
||||
os.umask(umask)
|
||||
|
||||
if isinstance(mods, six.string_types):
|
||||
mods = mods.split(',')
|
||||
@ -741,11 +743,11 @@ def sls(mods,
|
||||
msg = 'Unable to write to SLS cache file {0}. Check permission.'
|
||||
log.error(msg.format(cache_file))
|
||||
|
||||
os.umask(cumask)
|
||||
_set_retcode(ret)
|
||||
# Work around Windows multiprocessing bug, set __opts__['test'] back to
|
||||
# value from before this function was run.
|
||||
__opts__['test'] = orig_test
|
||||
|
||||
try:
|
||||
with salt.utils.fopen(cfn, 'w+b') as fp_:
|
||||
try:
|
||||
@ -756,6 +758,7 @@ def sls(mods,
|
||||
except (IOError, OSError):
|
||||
msg = 'Unable to write to highstate cache file {0}. Do you have permissions?'
|
||||
log.error(msg.format(cfn))
|
||||
os.umask(cumask)
|
||||
return ret
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user