patch-py_lekatnet_config_py 864 B

123456789101112131415161718192021222324252627
  1. $OpenBSD: patch-py_lekatnet_config_py,v 1.1 2010/10/20 11:29:46 dcoppa Exp $
  2. --- py/lekatnet/config.py.orig Wed Oct 20 13:06:10 2010
  3. +++ py/lekatnet/config.py Wed Oct 20 13:08:06 2010
  4. @@ -52,7 +52,7 @@ import pwd
  5. import tempfile
  6. import sys
  7. import tpg
  8. -import popen2
  9. +from subprocess import Popen, PIPE
  10. PARAMS = { 'ssh_path': "/usr/bin/ssh",
  11. 'rsh_path': "/usr/bin/rsh",
  12. @@ -265,10 +265,9 @@ class ConfigBase(dict):
  13. for dhost in dhosts:
  14. if not os.path.isabs(dhost):
  15. dhost = os.path.join(_user_dir, dhost)
  16. - p = popen2.Popen3(dhost, capturestderr=True)
  17. - p.tochild.close()
  18. - err = p.childerr.read()
  19. - out = p.fromchild.read()
  20. + p = Popen(dhost, stderr=PIPE, stdin=PIPE, stdout=PIPE, close_fds=True, shell=True)
  21. + err = p.stderr.read()
  22. + out = p.stdout.read()
  23. status = p.wait() >> 8
  24. if err:
  25. for line in err.split('\n'):