File tree 2 files changed +24
-2
lines changed
2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ disable = [
21
21
" C0115" , # missing-class-docstring
22
22
" C0116" , # missing-function-docstring
23
23
" C0301" , # line-too-long
24
+ " C0302" , # too-many-lines
24
25
" R0401" , # cyclic-import
25
26
" R0801" , # duplicate-code
26
27
" R0902" , # too-many-instance-attributes
Original file line number Diff line number Diff line change @@ -221,15 +221,36 @@ def run(config: RunnerConfig | None = None,
221
221
return r
222
222
223
223
224
- def run_async (** kwargs ):
224
+ def run_async (
225
+ config : RunnerConfig | None = None ,
226
+ streamer : str = "" ,
227
+ debug : bool = False ,
228
+ logfile : str = "" ,
229
+ ignore_logging : bool = True ,
230
+ _input : io .FileIO | None = None ,
231
+ _output : io .FileIO | None = None ,
232
+ only_transmit_kwargs : bool = False ,
233
+ ** kwargs ):
225
234
'''
226
235
Runs an Ansible Runner task in the background which will start immediately. Returns the thread object and a Runner object.
227
236
228
237
This uses the same parameters as :py:func:`ansible_runner.interface.run`
229
238
230
239
:returns: A tuple containing a :py:class:`threading.Thread` object and a :py:class:`ansible_runner.runner.Runner` object
231
240
'''
232
- r = init_runner (** kwargs )
241
+
242
+ # Initialize logging
243
+ if not ignore_logging :
244
+ output .configure (debug , logfile )
245
+
246
+ if not config :
247
+ config = RunnerConfig (** kwargs )
248
+
249
+ r = init_runner (
250
+ config = config , streamer = streamer ,
251
+ only_transmit_kwargs = only_transmit_kwargs ,
252
+ _input = _input , _output = _output ,
253
+ )
233
254
runner_thread = threading .Thread (target = r .run )
234
255
runner_thread .start ()
235
256
return runner_thread , r
You can’t perform that action at this time.
0 commit comments