mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Add object wrappers to file server return
This commit is contained in:
parent
55edae3a29
commit
3d345c41e8
@ -343,7 +343,8 @@ class MWorker(multiprocessing.Process):
|
||||
return ''
|
||||
fn_ = open(path, 'rb')
|
||||
fn_.seek(load['loc'])
|
||||
return self.crypticle.dumps(fn_.read(self.opts['file_buffer_size']))
|
||||
data = {'data': fn_.read(self.opts['file_buffer_size'])}
|
||||
return self.crypticle.dumps(data)
|
||||
|
||||
def _file_hash(self, load):
|
||||
'''
|
||||
|
@ -120,10 +120,10 @@ def cache_file(path):
|
||||
load['loc'] = fn_.tell()
|
||||
payload['load'] = auth.crypticle.dumps(load)
|
||||
socket.send_pyobj(payload)
|
||||
data = auth.crypticle.dumps(socket.recv())
|
||||
if not data:
|
||||
data = auth.crypticle.loads(socket.recv())
|
||||
if not data['data']:
|
||||
break
|
||||
fn_.write(data)
|
||||
fn_.write(data['data'])
|
||||
return dest
|
||||
else:
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user