diff options
author | Victor Stinner <vstinner@redhat.com> | 2015-10-15 16:57:42 +0200 |
---|---|---|
committer | Victor Stinner <vstinner@redhat.com> | 2015-11-05 13:31:40 +0100 |
commit | e01418018fbba2d47fdd1b921d27566037e547f4 (patch) | |
tree | baa267733cde553ffba7328c7f87a55ae3fc4400 /oslo_concurrency/processutils.py | |
parent | e55aee88691fa96783d275c953329e1aa6d3ac0b (diff) | |
download | oslo-concurrency-e01418018fbba2d47fdd1b921d27566037e547f4.tar.gz |
Use versionadded and versionchanged in doc
Document in which version new types and functions were added using
".. versionadded:: x.y". Document changes using
".. versionchanged:: x.y."
For watchdog module, add the versionadded tag in the module top
docstring, not on each type/function.
Add docstring to ssh_execute().
I used "git blame" + "git tag --contains=SHA1" to find these version,
and then I checked manually each version.
Change-Id: I56a7d8a4335833e9b49eedab026d20adfeedf942
Diffstat (limited to 'oslo_concurrency/processutils.py')
-rw-r--r-- | oslo_concurrency/processutils.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/oslo_concurrency/processutils.py b/oslo_concurrency/processutils.py index ef4c14f..a2f8896 100644 --- a/oslo_concurrency/processutils.py +++ b/oslo_concurrency/processutils.py @@ -99,7 +99,10 @@ def _subprocess_setup(on_preexec_fn): @enum.unique class LogErrors(enum.IntEnum): - """Enumerations that affect if stdout and stderr are logged on error.""" + """Enumerations that affect if stdout and stderr are logged on error. + + .. versionadded:: 2.7 + """ #: No logging on errors. DEFAULT = 0 @@ -190,6 +193,20 @@ def execute(*cmd, **kwargs): receiving unknown arguments :raises: :class:`ProcessExecutionError` :raises: :class:`OSError` + + .. versionchanged:: 1.5 + Added *cwd* optional parameter. + + .. versionchanged:: 1.9 + Added *binary* optional parameter. On Python 3, *stdout* and *stdout* + are now returned as Unicode strings by default, or bytes if *binary* is + true. + + .. versionchanged:: 2.1 + Added *on_execute* and *on_completion* optional parameters. + + .. versionchanged:: 2.3 + Added *preexec_fn* optional parameter. """ cwd = kwargs.pop('cwd', None) @@ -373,6 +390,11 @@ def trycmd(*args, **kwargs): def ssh_execute(ssh, cmd, process_input=None, addl_env=None, check_exit_code=True, binary=False): + """Run a command through SSH. + + .. versionchanged:: 1.9 + Added *binary* optional parameter. + """ sanitized_cmd = strutils.mask_password(cmd) LOG.debug('Running cmd (SSH): %s', sanitized_cmd) if addl_env: |