summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-04-24 16:22:42 +0300
committerLars Wirzenius <liw@liw.fi>2018-04-24 16:56:07 +0300
commitdf60c28287900478ced251123c9887e61e0dc17c (patch)
tree2707f15315f87ad86451e3651169fb68e5b7f0c3
parentc7a8322ea5e14898ca2659bc0d471f9006eea22e (diff)
downloadick2-df60c28287900478ced251123c9887e61e0dc17c.tar.gz
Change: when running commands, redirect stdin from /dev/null
-rw-r--r--NEWS3
-rw-r--r--ick2/actionenvs.py18
2 files changed, 13 insertions, 8 deletions
diff --git a/NEWS b/NEWS
index 0e55170..c703685 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,9 @@ Version 0.46+git, not yet released
you could leave it out and it would act as if `where: host` was
specified.
+* All commands run by worker manager now get their stdin redirected
+ from /dev/null.
+
Version 0.46, released 2018-04-22
----------------------------------
diff --git a/ick2/actionenvs.py b/ick2/actionenvs.py
index a21cef2..845d1d2 100644
--- a/ick2/actionenvs.py
+++ b/ick2/actionenvs.py
@@ -38,14 +38,16 @@ class Runner:
for key in kwargs:
logging.debug('Runner.runcmd: kwargs: %r=%r', key, kwargs[key])
assert all(argv is not None for argv in argvs)
- exit_code, _, _ = cliapp.runcmd_unchecked(
- *argvs,
- stdout_callback=self.capture_stdout,
- stderr=subprocess.STDOUT,
- output_timeout=self._timeout,
- timeout_callback=self.flush,
- **kwargs
- )
+ with open('/dev/null', 'rb') as devnull:
+ exit_code, _, _ = cliapp.runcmd_unchecked(
+ *argvs,
+ stdin=devnull,
+ stdout_callback=self.capture_stdout,
+ stderr=subprocess.STDOUT,
+ output_timeout=self._timeout,
+ timeout_callback=self.flush,
+ **kwargs
+ )
self.flush()
logging.debug('Runner.runcmd: finished, exit code: %d', exit_code)
return exit_code