私は Virtuozzo サーバーを扱っており、「vzctl enter」のサブプロセスを作成して、各コンテナーへのログインと Python でのいくつかのコマンドの発行を自動化したいと考えています。
ここに私が今取り組んでいるスニペットがあります -
#!/usr/bin/python
import subprocess
print 'Start'
proc = subprocess.Popen(['vzctl enter 123'],
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
shell=True)
print proc.communicate('whoami')[0]
print 'Finished'
しかし、私が毎回見る出力は -
Unable to get term attr: Invalid argument
Unable to restore term attr: Invalid argument
これは本当にBASHエラーだと思います。誰か提案してもらえますか?