##// END OF EJS Templates
fix for issue #2316; adding cluster_id to parallel.Client.__init__
Robert McGibbon -
Show More
@@ -229,6 +229,13 b' class Client(HasTraits):'
229 The name of the Cluster profile to be used to find connector information.
229 The name of the Cluster profile to be used to find connector information.
230 If run from an IPython application, the default profile will be the same
230 If run from an IPython application, the default profile will be the same
231 as the running application, otherwise it will be 'default'.
231 as the running application, otherwise it will be 'default'.
232 cluster_id : str
233 String id to added to runtime files, to prevent name collisions when using
234 multiple clusters with a single profile simultaneously.
235 When set, will look for files named like: 'ipcontroller-<cluster_id>-client.json'
236 Since this is text inserted into filenames, typical recommendations apply:
237 Simple character strings are ideal, and spaces are not recommended (but
238 should generally work)
232 context : zmq.Context
239 context : zmq.Context
233 Pass an existing zmq.Context instance, otherwise the client will create its own.
240 Pass an existing zmq.Context instance, otherwise the client will create its own.
234 debug : bool
241 debug : bool
@@ -366,7 +373,7 b' class Client(HasTraits):'
366 def __init__(self, url_file=None, profile=None, profile_dir=None, ipython_dir=None,
373 def __init__(self, url_file=None, profile=None, profile_dir=None, ipython_dir=None,
367 context=None, debug=False,
374 context=None, debug=False,
368 sshserver=None, sshkey=None, password=None, paramiko=None,
375 sshserver=None, sshkey=None, password=None, paramiko=None,
369 timeout=10, **extra_args
376 timeout=10, cluster_id=None, **extra_args
370 ):
377 ):
371 if profile:
378 if profile:
372 super(Client, self).__init__(debug=debug, profile=profile)
379 super(Client, self).__init__(debug=debug, profile=profile)
@@ -388,7 +395,11 b' class Client(HasTraits):'
388
395
389 if self._cd is not None:
396 if self._cd is not None:
390 if url_file is None:
397 if url_file is None:
391 url_file = pjoin(self._cd.security_dir, 'ipcontroller-client.json')
398 if cluster_id is None:
399 client_json = 'ipcontroller-client.json'
400 else:
401 client_json = 'ipcontroller-%s-client.json' % cluster_id
402 url_or_file = pjoin(self._cd.security_dir, client_json)
392 if url_file is None:
403 if url_file is None:
393 raise ValueError(
404 raise ValueError(
394 "I can't find enough information to connect to a hub!"
405 "I can't find enough information to connect to a hub!"
General Comments 0
You need to be logged in to leave comments. Login now