Skip to content

Commit

Permalink
Fix stdin issue when calling interactive boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Brandt committed Mar 9, 2018
1 parent 2e08c55 commit 0b1ce8f
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions dockeri/dockeri.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,19 +188,23 @@ def main(argv):
print( cmdline)
print( "#", '-'*(len(cmdline)-1))
else:
import shlex
import subprocess
cmdline = shlex.split(cmdline)
p = subprocess.Popen(cmdline,
#stdin=DEVNULL, #sys.stdin,
stdin=sys.stdin,
stdout=sys.stdout,
stderr=sys.stderr)
pid = p.pid
print("#", '-*-'*len(cmdline))
print("Container '{}' from image '{}' is running".format('nameit', image))
print("The parent's PID is: {}".format(pid))
print("#", '-*-'*len(cmdline))
os.system(cmdline)
# import shlex
# import subprocess
# from subprocess import Popen, PIPE
# cmdline = shlex.split(cmdline)
# p = Popen(cmdline,
# #stdin=DEVNULL, #sys.stdin,
# stdin=sys.stdin,
# stdout=sys.stdout,
# stderr=sys.stderr
# )
#
# pid = p.pid
# print("#", '-*-'*len(cmdline))
# print("Container '{}' from image '{}' is running".format(args.image, image))
# print("The parent's PID is: {}".format(pid))
# print("#", '-*-'*len(cmdline))

return os.EX_OK

0 comments on commit 0b1ce8f

Please sign in to comment.