mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
bitkeeper revision 1.1159.1.365 (418a0a91qNKrNOnOWtCM1nF1-HmNrA)
change readline to _readline to keep Twisted happy,
This commit is contained in:
1 parent
8550730aff
commit
aae8f96153
4 files changed
+13
-4
No files matched your search
@@ -15,6 +15,8 @@ from xen.sv.params import *
|
||||
from twisted.internet import reactor
|
||||
from twisted.web import static, server, script
|
||||
|
||||
from xen.util.ip import _readline, _readlines
|
||||
|
||||
class Daemon:
|
||||
"""The xend daemon.
|
||||
"""
|
||||
@@ -57,7 +59,7 @@ class Daemon:
|
||||
return 0
|
||||
# Read the pid of the previous invocation and search active process list.
|
||||
pid = open(PID_FILE, 'r').read()
|
||||
lines = os.popen('ps ' + pid + ' 2>/dev/null').readlines()
|
||||
lines = _readlines(os.popen('ps ' + pid + ' 2>/dev/null'))
|
||||
for line in lines:
|
||||
if re.search('^ *' + pid + '.+xensv', line):
|
||||
if not kill:
|
||||
|
||||
@@ -6,6 +6,9 @@ import sys
|
||||
import string
|
||||
|
||||
from xen.xend import XendRoot
|
||||
|
||||
from xen.util.ip import _readline, _readlines
|
||||
|
||||
xroot = XendRoot.instance()
|
||||
|
||||
"""Where network control scripts live."""
|
||||
@@ -37,6 +40,6 @@ def block(op, type, dets, script=None):
|
||||
args = ' '.join(args)
|
||||
out = os.popen(script + ' ' + args)
|
||||
|
||||
output = out.readline()
|
||||
output = _readline(out)
|
||||
out.close()
|
||||
return string.rstrip(output)
|
||||
@@ -35,6 +35,8 @@ from xen.xend.server import SrvServer
|
||||
from xen.xend import XendRoot
|
||||
from xen.xend.XendLogging import log
|
||||
|
||||
from xen.util.ip import _readline, _readlines
|
||||
|
||||
import channel
|
||||
import blkif
|
||||
import netif
|
||||
@@ -382,7 +384,7 @@ class Daemon:
|
||||
"""
|
||||
running = 0
|
||||
if pid:
|
||||
lines = os.popen('ps %d 2>/dev/null' % pid).readlines()
|
||||
lines = _readlines(os.popen('ps %d 2>/dev/null' % pid))
|
||||
exp = '^ *%d.+%s' % (pid, name)
|
||||
for line in lines:
|
||||
if re.search(exp, line):
|
||||
|
||||
@@ -16,6 +16,8 @@ import channel
|
||||
import controller
|
||||
from messages import *
|
||||
|
||||
from xen.util.ip import _readline, _readlines
|
||||
|
||||
def expand_dev_name(name):
|
||||
if re.match( '^/dev/', name ):
|
||||
return name
|
||||
@@ -25,7 +27,7 @@ def expand_dev_name(name):
|
||||
def check_mounted(self, name):
|
||||
mode = None
|
||||
name = expand_dev_name(name)
|
||||
lines = os.popen('mount 2>/dev/null').readlines()
|
||||
lines = _readlines(os.popen('mount 2>/dev/null'))
|
||||
exp = re.compile('^' + name + ' .*[\(,]r(?P<mode>[ow])[,\)]')
|
||||
for line in lines:
|
||||
pm = exp.match(line)
|
||||
|
||||