return binary return code with message
This commit is contained in:
parent
f8fc953530
commit
2d4dee498d
@ -99,7 +99,7 @@ class QueueControl(object):
|
|||||||
:param str operation: Known operation from :attr:`pymailq.CONFIG`.
|
:param str operation: Known operation from :attr:`pymailq.CONFIG`.
|
||||||
:param list messages: List of :class:`~store.Mail` objects targetted
|
:param list messages: List of :class:`~store.Mail` objects targetted
|
||||||
for operation.
|
for operation.
|
||||||
:return: Command's *stderr* output lines
|
:return: Command's *stderr* output lines, return code of binary
|
||||||
:rtype: :func:`list`
|
:rtype: :func:`list`
|
||||||
"""
|
"""
|
||||||
# validate that object's attribute "qid" exist. Raise AttributeError.
|
# validate that object's attribute "qid" exist. Raise AttributeError.
|
||||||
@ -135,7 +135,7 @@ class QueueControl(object):
|
|||||||
except BrokenPipeError:
|
except BrokenPipeError:
|
||||||
raise RuntimeError("Unexpected error: child process has crashed")
|
raise RuntimeError("Unexpected error: child process has crashed")
|
||||||
|
|
||||||
return [line.strip() for line in stderr.decode().split('\n')]
|
return [line.strip() for line in stderr.decode().split('\n')], child.returncode
|
||||||
|
|
||||||
# smtpctl do not use stdin, have to call the binary for each message :-(
|
# smtpctl do not use stdin, have to call the binary for each message :-(
|
||||||
else:
|
else:
|
||||||
@ -153,11 +153,11 @@ class QueueControl(object):
|
|||||||
|
|
||||||
stdout, stderr = child.communicate()
|
stdout, stderr = child.communicate()
|
||||||
if not len(stdout):
|
if not len(stdout):
|
||||||
return [line.strip() for line in stderr.decode().split('\n')]
|
return [line.strip() for line in stderr.decode().split('\n')], child.returncode
|
||||||
|
|
||||||
result.append(stdout.decode())
|
result.append(stdout.decode())
|
||||||
|
|
||||||
return result
|
return result, child.returncode, child.returncode
|
||||||
|
|
||||||
|
|
||||||
def delete_messages(self, messages):
|
def delete_messages(self, messages):
|
||||||
|
Loading…
Reference in New Issue
Block a user