Show More
@@ -364,6 +364,11 b' class Client(HasTraits):' | |||||
364 | """Turn valid target IDs or 'all' into two lists: |
|
364 | """Turn valid target IDs or 'all' into two lists: | |
365 | (int_ids, uuids). |
|
365 | (int_ids, uuids). | |
366 | """ |
|
366 | """ | |
|
367 | if not self._ids: | |||
|
368 | # flush notification socket if no engines yet, just in case | |||
|
369 | if not self.ids: | |||
|
370 | raise error.NoEnginesRegistered("Can't build targets without any engines") | |||
|
371 | ||||
367 | if targets is None: |
|
372 | if targets is None: | |
368 | targets = self._ids |
|
373 | targets = self._ids | |
369 | elif isinstance(targets, str): |
|
374 | elif isinstance(targets, str): | |
@@ -374,7 +379,7 b' class Client(HasTraits):' | |||||
374 | elif isinstance(targets, int): |
|
379 | elif isinstance(targets, int): | |
375 | if targets < 0: |
|
380 | if targets < 0: | |
376 | targets = self.ids[targets] |
|
381 | targets = self.ids[targets] | |
377 | if targets not in self.ids: |
|
382 | if targets not in self._ids: | |
378 | raise IndexError("No such engine: %i"%targets) |
|
383 | raise IndexError("No such engine: %i"%targets) | |
379 | targets = [targets] |
|
384 | targets = [targets] | |
380 |
|
385 | |||
@@ -910,13 +915,6 b' class Client(HasTraits):' | |||||
910 | if not isinstance(subheader, dict): |
|
915 | if not isinstance(subheader, dict): | |
911 | raise TypeError("subheader must be dict, not %s"%type(subheader)) |
|
916 | raise TypeError("subheader must be dict, not %s"%type(subheader)) | |
912 |
|
917 | |||
913 | if not self._ids: |
|
|||
914 | # flush notification socket if no engines yet |
|
|||
915 | any_ids = self.ids |
|
|||
916 | if not any_ids: |
|
|||
917 | raise error.NoEnginesRegistered("Can't execute without any connected engines.") |
|
|||
918 | # enforce types of f,args,kwargs |
|
|||
919 |
|
||||
920 | bufs = util.pack_apply_message(f,args,kwargs) |
|
918 | bufs = util.pack_apply_message(f,args,kwargs) | |
921 |
|
919 | |||
922 | msg = self.session.send(socket, "apply_request", buffers=bufs, ident=ident, |
|
920 | msg = self.session.send(socket, "apply_request", buffers=bufs, ident=ident, |
General Comments 0
You need to be logged in to leave comments.
Login now