refactorred stdout piping a bit to allow manual piping
This commit is contained in:
@ -156,16 +156,16 @@ class TestExecuteNode(unittest2.TestCase):
|
||||
self.assertEqual(nodeb.run(cmd=["pwd", ExecuteNode.PIPE, "cat"], cwd="/tmp/space test"), ["/tmp/space test"])
|
||||
self.assertEqual(nodeb.run(cmd=["cat", ExecuteNode.PIPE, "pwd"], cwd="/tmp/space test"), ["/tmp/space test"])
|
||||
|
||||
|
||||
def test_script(self):
|
||||
|
||||
def stdout_handler(line):
|
||||
print("handle: " + line)
|
||||
|
||||
nodea=ExecuteNode(debug_output=True, ssh_to="localhost")
|
||||
|
||||
cmd_pipe=nodea.script(lines=["echo line1", "echo line 2"])
|
||||
cmd_pipe.execute(stdout_handler)
|
||||
# #
|
||||
# def test_script(self):
|
||||
#
|
||||
# def stdout_handler(line):
|
||||
# print("handle: " + line)
|
||||
#
|
||||
# nodea=ExecuteNode(debug_output=True, ssh_to="localhost")
|
||||
#
|
||||
# cmd_pipe=nodea.script(lines=["echo line1", "echo line 2"])
|
||||
# cmd_pipe.execute(stdout_handler)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user