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 ''
|
return ''
|
||||||
fn_ = open(path, 'rb')
|
fn_ = open(path, 'rb')
|
||||||
fn_.seek(load['loc'])
|
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):
|
def _file_hash(self, load):
|
||||||
'''
|
'''
|
||||||
|
@ -120,10 +120,10 @@ def cache_file(path):
|
|||||||
load['loc'] = fn_.tell()
|
load['loc'] = fn_.tell()
|
||||||
payload['load'] = auth.crypticle.dumps(load)
|
payload['load'] = auth.crypticle.dumps(load)
|
||||||
socket.send_pyobj(payload)
|
socket.send_pyobj(payload)
|
||||||
data = auth.crypticle.dumps(socket.recv())
|
data = auth.crypticle.loads(socket.recv())
|
||||||
if not data:
|
if not data['data']:
|
||||||
break
|
break
|
||||||
fn_.write(data)
|
fn_.write(data['data'])
|
||||||
return dest
|
return dest
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user