ia64/xen-unstable

changeset 2875:5141b544ca25

bitkeeper revision 1.1159.1.365 (418a0a91qNKrNOnOWtCM1nF1-HmNrA)

change readline to _readline to keep Twisted happy,
author iap10@tetris.cl.cam.ac.uk
date Thu Nov 04 10:55:13 2004 +0000 (2004-11-04)
parents 2364cd863c91
children 5f61f7a86799
files tools/python/xen/sv/Daemon.py tools/python/xen/xend/Blkctl.py tools/python/xen/xend/server/SrvDaemon.py tools/python/xen/xend/server/blkif.py
line diff
     1.1 --- a/tools/python/xen/sv/Daemon.py	Thu Nov 04 10:33:34 2004 +0000
     1.2 +++ b/tools/python/xen/sv/Daemon.py	Thu Nov 04 10:55:13 2004 +0000
     1.3 @@ -15,6 +15,8 @@ from xen.sv.params import *
     1.4  from twisted.internet import reactor
     1.5  from twisted.web import static, server, script
     1.6  
     1.7 +from xen.util.ip import _readline, _readlines
     1.8 +
     1.9  class Daemon:
    1.10      """The xend daemon.
    1.11      """
    1.12 @@ -57,7 +59,7 @@ class Daemon:
    1.13              return 0
    1.14          # Read the pid of the previous invocation and search active process list.
    1.15          pid = open(PID_FILE, 'r').read()
    1.16 -        lines = os.popen('ps ' + pid + ' 2>/dev/null').readlines()
    1.17 +        lines = _readlines(os.popen('ps ' + pid + ' 2>/dev/null'))
    1.18          for line in lines:
    1.19              if re.search('^ *' + pid + '.+xensv', line):
    1.20                  if not kill:
     2.1 --- a/tools/python/xen/xend/Blkctl.py	Thu Nov 04 10:33:34 2004 +0000
     2.2 +++ b/tools/python/xen/xend/Blkctl.py	Thu Nov 04 10:55:13 2004 +0000
     2.3 @@ -6,6 +6,9 @@ import sys
     2.4  import string
     2.5  
     2.6  from xen.xend import XendRoot
     2.7 +
     2.8 +from xen.util.ip import _readline, _readlines
     2.9 +
    2.10  xroot = XendRoot.instance()
    2.11  
    2.12  """Where network control scripts live."""
    2.13 @@ -37,6 +40,6 @@ def block(op, type, dets, script=None):
    2.14      args = ' '.join(args)
    2.15      out = os.popen(script + ' ' + args)
    2.16  
    2.17 -    output = out.readline()
    2.18 +    output = _readline(out)
    2.19      out.close()
    2.20      return string.rstrip(output)
     3.1 --- a/tools/python/xen/xend/server/SrvDaemon.py	Thu Nov 04 10:33:34 2004 +0000
     3.2 +++ b/tools/python/xen/xend/server/SrvDaemon.py	Thu Nov 04 10:55:13 2004 +0000
     3.3 @@ -35,6 +35,8 @@ from xen.xend.server import SrvServer
     3.4  from xen.xend import XendRoot
     3.5  from xen.xend.XendLogging import log
     3.6  
     3.7 +from xen.util.ip import _readline, _readlines
     3.8 +
     3.9  import channel
    3.10  import blkif
    3.11  import netif
    3.12 @@ -382,7 +384,7 @@ class Daemon:
    3.13          """
    3.14          running = 0
    3.15          if pid:
    3.16 -            lines = os.popen('ps %d 2>/dev/null' % pid).readlines()
    3.17 +            lines = _readlines(os.popen('ps %d 2>/dev/null' % pid))
    3.18              exp = '^ *%d.+%s' % (pid, name)
    3.19              for line in lines:
    3.20                  if re.search(exp, line):
     4.1 --- a/tools/python/xen/xend/server/blkif.py	Thu Nov 04 10:33:34 2004 +0000
     4.2 +++ b/tools/python/xen/xend/server/blkif.py	Thu Nov 04 10:55:13 2004 +0000
     4.3 @@ -16,6 +16,8 @@ import channel
     4.4  import controller
     4.5  from messages import *
     4.6  
     4.7 +from xen.util.ip import _readline, _readlines
     4.8 +
     4.9  def expand_dev_name(name):
    4.10      if re.match( '^/dev/', name ):
    4.11  	return name
    4.12 @@ -25,7 +27,7 @@ def expand_dev_name(name):
    4.13  def check_mounted(self, name):
    4.14      mode = None
    4.15      name = expand_dev_name(name)
    4.16 -    lines = os.popen('mount 2>/dev/null').readlines()
    4.17 +    lines = _readlines(os.popen('mount 2>/dev/null'))
    4.18      exp = re.compile('^' + name + ' .*[\(,]r(?P<mode>[ow])[,\)]')
    4.19      for line in lines:
    4.20          pm = exp.match(line)