Show More
@@ -47,6 +47,7 b' from .view import DirectView, LoadBalancedView' | |||
|
47 | 47 | # Decorators for Client methods |
|
48 | 48 | #-------------------------------------------------------------------------- |
|
49 | 49 | |
|
50 | ||
|
50 | 51 | @decorator |
|
51 | 52 | def spin_first(f, self, *args, **kwargs): |
|
52 | 53 | """Call spin() to sync state prior to calling the method.""" |
@@ -58,6 +59,10 b' def spin_first(f, self, *args, **kwargs):' | |||
|
58 | 59 | # Classes |
|
59 | 60 | #-------------------------------------------------------------------------- |
|
60 | 61 | |
|
62 | _no_connection_file_msg = """ | |
|
63 | Failed to connect because no Controller could be found. | |
|
64 | Please double-check your profile and ensure that a cluster is running. | |
|
65 | """ | |
|
61 | 66 | |
|
62 | 67 | class ExecuteReply(RichOutput): |
|
63 | 68 | """wrapper for finished Execute results""" |
@@ -382,6 +387,11 b' class Client(HasTraits):' | |||
|
382 | 387 | |
|
383 | 388 | self._setup_profile_dir(self.profile, profile_dir, ipython_dir) |
|
384 | 389 | |
|
390 | no_file_msg = '\n'.join([ | |
|
391 | "You have attempted to connect to an IPython Cluster but no Controller could be found.", | |
|
392 | "Please double-check your configuration and ensure that a cluster is running.", | |
|
393 | ]) | |
|
394 | ||
|
385 | 395 | if self._cd is not None: |
|
386 | 396 | if url_file is None: |
|
387 | 397 | if not cluster_id: |
@@ -389,13 +399,17 b' class Client(HasTraits):' | |||
|
389 | 399 | else: |
|
390 | 400 | client_json = 'ipcontroller-%s-client.json' % cluster_id |
|
391 | 401 | url_file = pjoin(self._cd.security_dir, client_json) |
|
402 | if not os.path.exists(url_file): | |
|
403 | msg = '\n'.join([ | |
|
404 | "Connection file %r not found." % compress_user(url_file), | |
|
405 | no_file_msg, | |
|
406 | ]) | |
|
407 | raise IOError(msg) | |
|
392 | 408 | if url_file is None: |
|
393 |
raise |
|
|
394 | "I can't find enough information to connect to a hub!" | |
|
395 | " Please specify at least one of url_file or profile." | |
|
396 | ) | |
|
409 | raise IOError(no_file_msg) | |
|
397 | 410 | |
|
398 | 411 | if not os.path.exists(url_file): |
|
412 | # Connection file explicitly specified, but not found | |
|
399 | 413 | raise IOError("Connection file %r not found. Is a controller running?" % \ |
|
400 | 414 | compress_user(url_file) |
|
401 | 415 | ) |
General Comments 0
You need to be logged in to leave comments.
Login now