Supppress output in ControlMaster's polling
In a SSH link, a thread will be spawned to monitor the
process run via the SSH link. It will keep polling the
status of the process, and monitor the connection status.
To check if the connection is still in a good state, it
uses 'ssh -O check' to check the status. However, this
will output a string 'Master running (pid=xxx)' to
standard output/error stream.
To fix this, the output of this specific is marked
as pipe, which keeps the output console clean.
BUG=none
TEST=none
Change-Id: Ie1cd343ba91d096246485683842edf2ad362f742
Reviewed-on: https://chromium-review.googlesource.com/566170
Commit-Ready: Shen-En Shih <[email protected]>
Tested-by: Shen-En Shih <[email protected]>
Reviewed-by: Chih-Yu Huang <[email protected]>
diff --git a/graphyte/links/ssh.py b/graphyte/links/ssh.py
index ab78c51..0b57bb4 100644
--- a/graphyte/links/ssh.py
+++ b/graphyte/links/ssh.py
@@ -211,7 +211,9 @@
def _IsControlMasterRunning():
sig, options = _GetLinkSignature(False)
return subprocess.call(
- ['ssh', '-O', 'check'] + options + [sig, 'true']) == 0
+ ['ssh', '-O', 'check'] + options + [sig, 'true'],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE) == 0
def _StopControlMaster():
sig, options = _GetLinkSignature(False)