Skip to content

Commit

Permalink
cli: remove double newline character from _exec_cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
ivotron committed Aug 13, 2020
1 parent 5874da6 commit 239f964
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/popper/runner_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ def _exec_cmd(cmd, env=None, cwd=os.getcwd(), pids=set(), logging=True):
output = []
for line in iter(p.stdout.readline, ""):
if logging:
log.step_info(line)
log.step_info(line.rstrip())
else:
output.append(line)
output.append(line.rstrip())

p.wait()
ecode = p.poll()
Expand Down
4 changes: 2 additions & 2 deletions src/test/test_runner_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ def test_exec_cmd(self):
pid, ecode, output = HostRunner._exec_cmd(cmd, logging=False)
self.assertGreater(pid, 0)
self.assertEqual(ecode, 0)
self.assertEqual(output, "hello-world\n")
self.assertEqual(output, "hello-world")

with LogCapture("popper") as logc:
pid, ecode, output = HostRunner._exec_cmd(cmd)
self.assertGreater(pid, 0)
self.assertEqual(ecode, 0)
self.assertEqual(output, "")
logc.check_present(("popper", "STEP_INFO", "hello-world\n"))
logc.check_present(("popper", "STEP_INFO", "hello-world"))

cmd = ["env"]
pid, ecode, output = HostRunner._exec_cmd(
Expand Down

1 comment on commit 239f964

@edeediong
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see... the underlying function was changed that's why podman runner test had to change

Please sign in to comment.