##// END OF EJS Templates
propagate signature_scheme config to parallel connection files
MinRK -
Show More
@@ -251,7 +251,7 b' class IPControllerApp(BaseParallelApplication):'
251 ecfg = json.loads(f.read())
251 ecfg = json.loads(f.read())
252
252
253 # json gives unicode, Session.key wants bytes
253 # json gives unicode, Session.key wants bytes
254 c.Session.key = ecfg['exec_key'].encode('ascii')
254 c.Session.key = ecfg['key'].encode('ascii')
255
255
256 xport,ip = ecfg['interface'].split('://')
256 xport,ip = ecfg['interface'].split('://')
257
257
@@ -269,7 +269,7 b' class IPControllerApp(BaseParallelApplication):'
269 with open(fname) as f:
269 with open(fname) as f:
270 ccfg = json.loads(f.read())
270 ccfg = json.loads(f.read())
271
271
272 for key in ('exec_key', 'registration', 'pack', 'unpack'):
272 for key in ('key', 'registration', 'pack', 'unpack', 'signature_scheme'):
273 assert ccfg[key] == ecfg[key], "mismatch between engine and client info: %r" % key
273 assert ccfg[key] == ecfg[key], "mismatch between engine and client info: %r" % key
274
274
275 xport,addr = ccfg['interface'].split('://')
275 xport,addr = ccfg['interface'].split('://')
@@ -338,10 +338,11 b' class IPControllerApp(BaseParallelApplication):'
338 # save to new json config files
338 # save to new json config files
339 f = self.factory
339 f = self.factory
340 base = {
340 base = {
341 'exec_key' : f.session.key.decode('ascii'),
341 'key' : f.session.key.decode('ascii'),
342 'location' : self.location,
342 'location' : self.location,
343 'pack' : f.session.packer,
343 'pack' : f.session.packer,
344 'unpack' : f.session.unpacker,
344 'unpack' : f.session.unpacker,
345 'signature_scheme' : f.session.signature_scheme,
345 }
346 }
346
347
347 cdict = {'ssh' : self.ssh_server}
348 cdict = {'ssh' : self.ssh_server}
@@ -227,9 +227,10 b' class IPEngineApp(BaseParallelApplication):'
227 ip = disambiguate_ip_address(ip, location)
227 ip = disambiguate_ip_address(ip, location)
228 d['interface'] = '%s://%s' % (proto, ip)
228 d['interface'] = '%s://%s' % (proto, ip)
229
229
230 # DO NOT allow override of basic URLs, serialization, or exec_key
230 # DO NOT allow override of basic URLs, serialization, or key
231 # JSON file takes top priority there
231 # JSON file takes top priority there
232 config.Session.key = cast_bytes(d['exec_key'])
232 config.Session.key = cast_bytes(d['key'])
233 config.Session.signature_scheme = d['signature_scheme']
233
234
234 config.EngineFactory.url = d['interface'] + ':%i' % d['registration']
235 config.EngineFactory.url = d['interface'] + ':%i' % d['registration']
235
236
@@ -462,7 +462,8 b' class Client(HasTraits):'
462 # configure and construct the session
462 # configure and construct the session
463 extra_args['packer'] = cfg['pack']
463 extra_args['packer'] = cfg['pack']
464 extra_args['unpacker'] = cfg['unpack']
464 extra_args['unpacker'] = cfg['unpack']
465 extra_args['key'] = cast_bytes(cfg['exec_key'])
465 extra_args['key'] = cast_bytes(cfg['key'])
466 extra_args['signature_scheme'] = cfg['signature_scheme']
466
467
467 self.session = Session(**extra_args)
468 self.session = Session(**extra_args)
468
469
General Comments 0
You need to be logged in to leave comments. Login now