diff options
Diffstat (limited to 'src/pybind/mgr/mgr_module.py')
-rw-r--r-- | src/pybind/mgr/mgr_module.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/pybind/mgr/mgr_module.py b/src/pybind/mgr/mgr_module.py index e425d129b8a..7a7e0db6e7d 100644 --- a/src/pybind/mgr/mgr_module.py +++ b/src/pybind/mgr/mgr_module.py @@ -106,14 +106,25 @@ class CommandResult(object): class HandleCommandResult(namedtuple('HandleCommandResult', ['retval', 'stdout', 'stderr'])): - def __new__(cls, retval=0, odata="", rs=""): + def __new__(cls, retval=0, stdout="", stderr=""): """ Tuple containing the result of `handle_command()` + + Only write to stderr if there is an error, or in extraordinary circumstances + + Avoid having `ceph foo bar` commands say "did foo bar" on success unless there + is critical information to include there. + + Everything programmatically consumable should be put on stdout + :param retval: return code. E.g. 0 or -errno.EINVAL - :param odata: data of this result. - :param rs: Typically used for error or status messages. + :type retval: int + :param stdout: data of this result. + :type stdout: str + :param stderr: Typically used for error messages. + :type stderr: str """ - return super(HandleCommandResult, cls).__new__(cls, retval, odata, rs) + return super(HandleCommandResult, cls).__new__(cls, retval, stdout, stderr) class OSDMap(ceph_module.BasePyOSDMap): |