[gestion/] Kill popen, subprocess ftw

On diminue le nombre de DeprecationWarnings ...

darcs-hash:20110307225857-ddb99-74a1452ba6f828f102e8803de1307e8147314887.gz
This commit is contained in:
Michel Blockelet 2011-03-07 23:58:57 +01:00
parent ecb6e01317
commit e9242a36af
3 changed files with 9 additions and 8 deletions

View file

@ -56,7 +56,7 @@ from ldap_crans import MachineCrans, MachineWifi, BorneWifi
from ldap_crans import Adherent
from affich_tools import *
import user_tests
import popen2, commands
import subprocess, commands
limit_aff_details = 1
limit_aff_machines = 15
@ -939,9 +939,11 @@ def borne_clients_canal(borne) :
for clef in ["/etc/wifi/ssh/wifi","/usr/scripts/gestion/clef-wifi"]:
if os.path.isfile(clef) and user_tests.isadm():
try:
wl = popen2.Popen3("ssh -o StrictHostKeyChecking=no -i %s root@%s 'cat /tmp/auth-mac.dump ; echo -n \"CANAL \" ; /usr/sbin/nvram get wl0_channel' 2> /dev/null" % (clef, borne))
wl.tochild.close()
for line in wl.fromchild.readlines():
wl = subprocess.Popen("ssh -o StrictHostKeyChecking=no -i %s root@%s 'cat /tmp/auth-mac.dump ; echo -n \"CANAL \" ; /usr/sbin/nvram get wl0_channel'" % (clef, borne), shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
wl.stdin.close()
for line in wl.stdout.readlines():
print 'coucou'
print line
# Chaque ligne est de la forme
# 00:11:22:33:44:55 -20
line = line.strip().split()