summaryrefslogtreecommitdiffstats
path: root/openstack/common/processutils.py
diff options
context:
space:
mode:
authorJoe Heck <heckj@mac.com>2012-11-11 21:00:42 +0000
committerJoe Heck <heckj@mac.com>2012-11-18 18:19:50 -0800
commitb6d24bbad9493b4318367c23cbab8c4f688a924a (patch)
tree12b9a67982eef705d29433a7dbb0b1e8a931bbd0 /openstack/common/processutils.py
parent8aca5eb5868b5ead362777abb093f11c6d8b1817 (diff)
downloadoslo-b6d24bbad9493b4318367c23cbab8c4f688a924a.tar.gz
oslo-b6d24bbad9493b4318367c23cbab8c4f688a924a.tar.xz
oslo-b6d24bbad9493b4318367c23cbab8c4f688a924a.zip
updating sphinx documentation
* adding openstack theming (copied from keystone project theme) * updating .gitignore to ignore generated API docs * updated formatting in index.rst page * updaed openstack/common/processutils.py to match hacking docstring * updated docstrings to resolve sphinx warnings Change-Id: Ie89afe20eeab1efd2daf440fc65ccdf90f723c51
Diffstat (limited to 'openstack/common/processutils.py')
-rw-r--r--openstack/common/processutils.py43
1 files changed, 27 insertions, 16 deletions
diff --git a/openstack/common/processutils.py b/openstack/common/processutils.py
index a21db01..578a660 100644
--- a/openstack/common/processutils.py
+++ b/openstack/common/processutils.py
@@ -51,22 +51,33 @@ class ProcessExecutionError(Exception):
def execute(*cmd, **kwargs):
"""
- Helper method to execute command with optional retry.
-
- :cmd Passed to subprocess.Popen.
- :process_input Send to opened process.
- :check_exit_code Defaults to 0. Raise executils.ProcessExecutionError
- unless program exits with this code.
- :delay_on_retry True | False. Defaults to True. If set to True, wait a
- short amount of time before retrying.
- :attempts How many times to retry cmd.
- :run_as_root True | False. Defaults to False. If set to True,
- the command is prefixed by the command specified
- in the root_helper kwarg.
- :root_helper command to prefix all cmd's with
-
- :raises executils.UnknownArgumentError on receiving unknown arguments
- :raises executils.ProcessExecutionError
+ Helper method to shell out and execute a command through subprocess with
+ optional retry.
+
+ :param cmd: Passed to subprocess.Popen.
+ :type cmd: string
+ :param process_input: Send to opened process.
+ :type proces_input: string
+ :param check_exit_code: Defaults to 0. Will raise
+ :class:`ProcessExecutionError`
+ if the command exits without returning this value
+ as a returncode
+ :type check_exit_code: int
+ :param delay_on_retry: True | False. Defaults to True. If set to True,
+ wait a short amount of time before retrying.
+ :type delay_on_retry: boolean
+ :param attempts: How many times to retry cmd.
+ :type attempts: int
+ :param run_as_root: True | False. Defaults to False. If set to True,
+ the command is prefixed by the command specified
+ in the root_helper kwarg.
+ :type run_as_root: boolean
+ :param root_helper: command to prefix all cmd's with
+ :type root_helper: string
+ :returns: (stdout, stderr) from process execution
+ :raises: :class:`UnknownArgumentError` on
+ receiving unknown arguments
+ :raises: :class:`ProcessExecutionError`
"""
process_input = kwargs.pop('process_input', None)