Skip to content

Instantly share code, notes, and snippets.

@thatch45
Created July 8, 2011 05:52
Show Gist options
  • Save thatch45/1071229 to your computer and use it in GitHub Desktop.
Save thatch45/1071229 to your computer and use it in GitHub Desktop.
def _return_pub(self, ret):
'''
Return the data from the executed command to the master server
'''
log.info('Returning information for job: %(jid)s', ret)
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect(self.opts['master_uri'])
payload = {'enc': 'aes'}
load = {'return': ret['return'],
'cmd': '_return',
'jid': ret['jid'],
'id': self.opts['id']}
if hasattribute(self.functions[ret['fun']], '__output'):
load['output'] = self.functions[ret['fun']].__output
payload['load'] = self.crypticle.dumps(load)
socket.send_pyobj(payload)
return socket.recv()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment