diff options
author | iap10@tetris.cl.cam.ac.uk <iap10@tetris.cl.cam.ac.uk> | 2004-11-04 10:55:13 +0000 |
---|---|---|
committer | iap10@tetris.cl.cam.ac.uk <iap10@tetris.cl.cam.ac.uk> | 2004-11-04 10:55:13 +0000 |
commit | aae8f96153c8dfb75575d05055fa209672380018 (patch) | |
tree | 9c27319f046e609307f8562948560f2af31d424f | |
parent | 8550730aff8db8061ed13537e0b9f7a7492342e1 (diff) | |
download | xen-aae8f96153c8dfb75575d05055fa209672380018.tar.gz xen-aae8f96153c8dfb75575d05055fa209672380018.tar.bz2 xen-aae8f96153c8dfb75575d05055fa209672380018.zip |
bitkeeper revision 1.1159.1.365 (418a0a91qNKrNOnOWtCM1nF1-HmNrA)
change readline to _readline to keep Twisted happy,
-rw-r--r-- | tools/python/xen/sv/Daemon.py | 4 | ||||
-rw-r--r-- | tools/python/xen/xend/Blkctl.py | 5 | ||||
-rw-r--r-- | tools/python/xen/xend/server/SrvDaemon.py | 4 | ||||
-rwxr-xr-x | tools/python/xen/xend/server/blkif.py | 4 |
4 files changed, 13 insertions, 4 deletions
diff --git a/tools/python/xen/sv/Daemon.py b/tools/python/xen/sv/Daemon.py index 510cfa9f04..5a8d18e5e4 100644 --- a/tools/python/xen/sv/Daemon.py +++ b/tools/python/xen/sv/Daemon.py @@ -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: diff --git a/tools/python/xen/xend/Blkctl.py b/tools/python/xen/xend/Blkctl.py index a5bda19470..d90c7ce51d 100644 --- a/tools/python/xen/xend/Blkctl.py +++ b/tools/python/xen/xend/Blkctl.py @@ -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) diff --git a/tools/python/xen/xend/server/SrvDaemon.py b/tools/python/xen/xend/server/SrvDaemon.py index 41a5965221..05a0f27201 100644 --- a/tools/python/xen/xend/server/SrvDaemon.py +++ b/tools/python/xen/xend/server/SrvDaemon.py @@ -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): diff --git a/tools/python/xen/xend/server/blkif.py b/tools/python/xen/xend/server/blkif.py index 9ca8eab5fe..1e06c55345 100755 --- a/tools/python/xen/xend/server/blkif.py +++ b/tools/python/xen/xend/server/blkif.py @@ -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) |