projects
/
cdist.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4f31e45
)
Only make docker sessions interactive if stdin is a TTY.
author
Carl Hetherington
<cth@carlh.net>
Tue, 17 Mar 2020 08:37:11 +0000
(09:37 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Tue, 17 Mar 2020 08:37:11 +0000
(09:37 +0100)
cdist
patch
|
blob
|
history
diff --git
a/cdist
b/cdist
index 4c21cef55fc3847d33fc028fe2ac51835527db08..39568d64f154ce068aa73afa5949cd551e8d447b 100755
(executable)
--- a/
cdist
+++ b/
cdist
@@
-553,7
+553,8
@@
class DockerTarget(Target):
def command(self, cmd):
dir = os.path.join(self.directory, os.path.relpath(os.getcwd(), self.directory))
def command(self, cmd):
dir = os.path.join(self.directory, os.path.relpath(os.getcwd(), self.directory))
- command('%s exec %s -i -t %s /bin/bash -c \'export %s; cd %s; %s\'' % (config.docker(), self._user_tag(), self.container, self.variables_string(), dir, cmd))
+ interactive_flag = '-i ' if sys.stdin.isatty() else ''
+ command('%s exec %s %s -t %s /bin/bash -c \'export %s; cd %s; %s\'' % (config.docker(), self._user_tag(), interactive_flag, self.container, self.variables_string(), dir, cmd))
def cleanup(self):
super(DockerTarget, self).cleanup()
def cleanup(self):
super(DockerTarget, self).cleanup()