mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
commit
015cbc57d9
1 changed files with 10 additions and 2 deletions
|
@ -37,6 +37,7 @@ import salt.utils.dictupdate
|
|||
import salt.utils.event
|
||||
import salt.utils.url
|
||||
import salt.utils.process
|
||||
import salt.utils.files
|
||||
import salt.syspaths as syspaths
|
||||
from salt.utils import immutabletypes
|
||||
from salt.template import compile_template, compile_template_str
|
||||
|
@ -146,6 +147,13 @@ def _gen_tag(low):
|
|||
return '{0[state]}_|-{0[__id__]}_|-{0[name]}_|-{0[fun]}'.format(low)
|
||||
|
||||
|
||||
def _clean_tag(tag):
|
||||
'''
|
||||
Make tag name safe for filenames
|
||||
'''
|
||||
return salt.utils.files.safe_filename_leaf(tag)
|
||||
|
||||
|
||||
def _l_tag(name, id_):
|
||||
low = {'name': 'listen_{0}'.format(name),
|
||||
'__id__': 'listen_{0}'.format(id_),
|
||||
|
@ -1695,7 +1703,7 @@ class State(object):
|
|||
trb)
|
||||
}
|
||||
troot = os.path.join(self.opts['cachedir'], self.jid)
|
||||
tfile = os.path.join(troot, tag)
|
||||
tfile = os.path.join(troot, _clean_tag(tag))
|
||||
if not os.path.isdir(troot):
|
||||
try:
|
||||
os.makedirs(troot)
|
||||
|
@ -2047,7 +2055,7 @@ class State(object):
|
|||
proc = running[tag].get('proc')
|
||||
if proc:
|
||||
if not proc.is_alive():
|
||||
ret_cache = os.path.join(self.opts['cachedir'], self.jid, tag)
|
||||
ret_cache = os.path.join(self.opts['cachedir'], self.jid, _clean_tag(tag))
|
||||
if not os.path.isfile(ret_cache):
|
||||
ret = {'result': False,
|
||||
'comment': 'Parallel process failed to return',
|
||||
|
|
Loading…
Add table
Reference in a new issue