mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix a bunch of state_top issues
This commit is contained in:
parent
01bbf9c530
commit
dcb0bb5884
3 changed files with 7 additions and 7 deletions
|
@ -344,10 +344,10 @@ class MWorker(multiprocessing.Process):
|
|||
if not load.has_key('path')\
|
||||
or not load.has_key('loc')\
|
||||
or not load.has_key('env'):
|
||||
return False
|
||||
return self.crypticle.dumps('')
|
||||
path = self._find_file(load['path'], load['env'])
|
||||
if not path:
|
||||
return False
|
||||
return self.crypticle.dumps('')
|
||||
fn_ = open(path, 'rb')
|
||||
fn_.seek(load['loc'])
|
||||
return self.crypticle.dumps(fn_.read(self.opts['file_buffer_size']))
|
||||
|
@ -361,7 +361,7 @@ class MWorker(multiprocessing.Process):
|
|||
return False
|
||||
path = self._find_file(load['path'], load['env'])
|
||||
if not path:
|
||||
return ''
|
||||
return self.crypticle.dumps('')
|
||||
ret = {}
|
||||
ret['hsum'] = getattr(hashlib, self.opts['hash_type'])(
|
||||
open(path, 'rb').read()).hexdigest()
|
||||
|
|
|
@ -352,7 +352,7 @@ class FileClient(object):
|
|||
'''
|
||||
if not path.startswith('salt://'):
|
||||
raise MinionError('Unsupported path')
|
||||
return path[:7]
|
||||
return path[7:]
|
||||
|
||||
def get_file(self, path, dest, makedirs=False, env='base'):
|
||||
'''
|
||||
|
|
|
@ -306,10 +306,10 @@ class HighState(object):
|
|||
opts['renderer'] = mopts['renderer']
|
||||
if mopts['state_top'].startswith('salt://'):
|
||||
opts['state_top'] = mopts['state_top']
|
||||
elif not mopts['state_top'].startswith('/'):
|
||||
opts['state_top'] = os.path.join('salt://', mopts['state_top'][1:])
|
||||
elif mopts['state_top'].startswith('/'):
|
||||
opts['state_top'] = os.path.join('salt://', mopts['state_top'][1:])
|
||||
else:
|
||||
opts['state_top'] = os.path.join('salt://', mopts['state_top'])
|
||||
opts['state_top'] = os.path.join('salt://', mopts['state_top'])
|
||||
return opts
|
||||
|
||||
def get_top(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue