Skip to content

Commit 4dc1ca8

Browse files
committed
Pass through keyword arguments from start methods to Launchers
easier than building the config object
1 parent 508af10 commit 4dc1ca8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

ipyparallel/cluster/cluster.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,21 +257,26 @@ def to_json(self):
257257
"""Serialize a Cluster object for later reconstruction"""
258258
raise NotImplementedError()
259259

260-
async def start_controller(self):
261-
"""Start the controller"""
260+
async def start_controller(self, **kwargs):
261+
"""Start the controller
262+
263+
Keyword arguments are passed to the controller launcher constructor
264+
"""
262265
# start controller
263266
# retrieve connection info
264267
# webhook?
265268
if self._controller is not None:
266269
raise RuntimeError(
267270
"controller is already running. Call stop_controller() first."
268271
)
272+
269273
self._controller = controller = self.controller_launcher_class(
270274
work_dir=u'.',
271275
parent=self,
272276
log=self.log,
273277
profile_dir=self.profile_dir,
274278
cluster_id=self.cluster_id,
279+
**kwargs,
275280
)
276281

277282
controller_args = getattr(controller, 'controller_args', None)
@@ -305,7 +310,7 @@ def _controller_stopped(self, stop_data=None):
305310
"""Callback when a controller stops"""
306311
self.log.info(f"Controller stopped: {stop_data}")
307312

308-
async def start_engines(self, n=None, engine_set_id=None):
313+
async def start_engines(self, n=None, engine_set_id=None, **kwargs):
309314
"""Start an engine set
310315
311316
Returns an engine set id which can be used in stop_engines
@@ -319,6 +324,7 @@ async def start_engines(self, n=None, engine_set_id=None):
319324
log=self.log,
320325
profile_dir=self.profile_dir,
321326
cluster_id=self.cluster_id,
327+
**kwargs,
322328
)
323329
if n is None:
324330
n = self.n

0 commit comments

Comments
 (0)