@@ -182,7 +182,7 @@ API: SSHClient and SSHAuth.
182182
183183 .. versionadded :: 2.9.4
184184
185- .. py :method :: check_call(command, verbose = False , timeout = 1 * 60 * 60 , error_info = None , expected = None , raise_on_err = True , * , exception_class = CalledProcessError, ** kwargs)
185+ .. py :method :: check_call(command, verbose = False , timeout = 1 * 60 * 60 , error_info = None , expected = ( 0 ,) , raise_on_err = True , * , exception_class = CalledProcessError, ** kwargs)
186186
187187 Execute command and check for return code.
188188
@@ -195,7 +195,7 @@ API: SSHClient and SSHAuth.
195195 :param error_info: Text for error details, if fail happens
196196 :type error_info: ``typing.Optional[str] ``
197197 :param expected: expected return codes (0 by default)
198- :type expected: `` typing.Optional [typing.Iterable [int]] ``
198+ :type expected: typing.Iterable [typing.Union [int, ExitCodes]]
199199 :param raise_on_err: Raise exception on unexpected return code
200200 :type raise_on_err: ``bool ``
201201 :param exception_class: Exception class for errors. Subclass of CalledProcessError is mandatory.
@@ -206,8 +206,9 @@ API: SSHClient and SSHAuth.
206206
207207 .. versionchanged :: 1.2.0 default timeout 1 hour
208208 .. versionchanged :: 3.2.0 Exception class can be substituted
209+ .. versionchanged :: 2.11.0 Expected is not optional, defaults os dependent
209210
210- .. py :method :: check_stderr(command, verbose = False , timeout = 1 * 60 * 60 , error_info = None , raise_on_err = True , * , expected = None , exception_class = CalledProcessError, ** kwargs)
211+ .. py :method :: check_stderr(command, verbose = False , timeout = 1 * 60 * 60 , error_info = None , raise_on_err = True , * , expected = ( 0 ,) , exception_class = CalledProcessError, ** kwargs)
211212
212213 Execute command expecting return code 0 and empty STDERR.
213214
@@ -222,7 +223,7 @@ API: SSHClient and SSHAuth.
222223 :param raise_on_err: Raise exception on unexpected return code
223224 :type raise_on_err: ``bool ``
224225 :param expected: expected return codes (0 by default)
225- :type expected: typing.Optional[typing. Iterable[typing.Union[int, ExitCodes] ]]
226+ :type expected: typing.Iterable[typing.Union[int, ExitCodes]]
226227 :param exception_class: Exception class for errors. Subclass of CalledProcessError is mandatory.
227228 :type exception_class: typing.Type[CalledProcessError]
228229 :rtype: ExecResult
@@ -232,7 +233,7 @@ API: SSHClient and SSHAuth.
232233 .. versionchanged :: 1.2.0 default timeout 1 hour
233234 .. versionchanged :: 3.2.0 Exception class can be substituted
234235
235- .. py :method :: execute_through_host(hostname, command, auth = None , target_port = 22 , verbose = False , timeout = 1 * 60 * 60 , * , get_pty = False , width = 80 , height = 24 , ** kwargs)
236+ .. py :method :: execute_through_host(hostname, command, auth = None , target_port = 22 , verbose = False , timeout = 1 * 60 * 60 , * , stdin = None , log_mask_re = " " , get_pty = False , width = 80 , height = 24 , ** kwargs)
236237
237238 Execute command on remote host through currently connected host.
238239
@@ -248,6 +249,11 @@ API: SSHClient and SSHAuth.
248249 :type verbose: ``bool ``
249250 :param timeout: Timeout for command execution.
250251 :type timeout: ``typing.Union[int, float, None] ``
252+ :param stdin: pass STDIN text to the process
253+ :type stdin: typing.Union[bytes, str, bytearray, None]
254+ :param log_mask_re: regex lookup rule to mask command for logger.
255+ all MATCHED groups will be replaced by '<*masked *>'
256+ :type log_mask_re: typing.Optional[str]
251257 :param get_pty: open PTY on target machine
252258 :type get_pty: ``bool ``
253259 :param width: PTY width
@@ -260,8 +266,9 @@ API: SSHClient and SSHAuth.
260266 .. versionchanged :: 1.2.0 default timeout 1 hour
261267 .. versionchanged :: 3.2.0 Expose pty options as optional keyword-only arguments
262268 .. versionchanged :: 3.2.0 Exception class can be substituted
269+ .. versionchanged :: 2.11.0 Expose stdin and log_mask_re as optional keyword-only arguments
263270
264- .. py :classmethod :: execute_together(remotes, command, timeout = 1 * 60 * 60 , expected = None , raise_on_err = True , * , exception_class = ParallelCallProcessError, ** kwargs)
271+ .. py :classmethod :: execute_together(remotes, command, timeout = 1 * 60 * 60 , expected = ( 0 ,), raise_on_err = True , * , stdin = None , log_mask_re = " " , exception_class = ParallelCallProcessError, ** kwargs)
265272
266273 Execute command on multiple remotes in async mode.
267274
@@ -272,9 +279,14 @@ API: SSHClient and SSHAuth.
272279 :param timeout: Timeout for command execution.
273280 :type timeout: ``typing.Union[int, float, None] ``
274281 :param expected: expected return codes (0 by default)
275- :type expected: `` typing.Optional [typing.Iterable[]] ``
282+ :type expected: typing.Iterable [typing.Union[int, ExitCodes]]
276283 :param raise_on_err: Raise exception on unexpected return code
277284 :type raise_on_err: ``bool ``
285+ :param stdin: pass STDIN text to the process
286+ :type stdin: typing.Union[bytes, str, bytearray, None]
287+ :param log_mask_re: regex lookup rule to mask command for logger.
288+ all MATCHED groups will be replaced by '<*masked *>'
289+ :type log_mask_re: typing.Optional[str]
278290 :param exception_class: Exception to raise on error. Mandatory subclass of ParallelCallProcessError
279291 :type exception_class: typing.Type[ParallelCallProcessError]
280292 :return: dictionary {(hostname, port): result}
@@ -284,6 +296,8 @@ API: SSHClient and SSHAuth.
284296
285297 .. versionchanged :: 1.2.0 default timeout 1 hour
286298 .. versionchanged :: 3.2.0 Exception class can be substituted
299+ .. versionchanged :: 2.11.0 Expected is not optional, defaults os dependent
300+ .. versionchanged :: 2.11.0 Expose stdin and log_mask_re as optional keyword-only arguments
287301
288302 .. py :method :: open (path, mode = ' r' )
289303
@@ -448,3 +462,9 @@ API: SSHClient and SSHAuth.
448462 .. py :attribute :: stdout
449463
450464 ``typing.Optional[paramiko.ChannelFile] ``
465+
466+ .. py :attribute :: started
467+
468+ ``datetime.datetime ``
469+
470+ .. versionadded :: 2.11.0
0 commit comments