ia64/xen-unstable

changeset 8146:7c90df7df37e

Miscellaneous tidying up, no semantic changes.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Wed Nov 30 19:48:54 2005 +0000 (2005-11-30)
parents b7790c2874c4
children 6a2acc1cc505
files tools/python/xen/xend/XendCheckpoint.py tools/python/xen/xend/XendProtocol.py tools/python/xen/xend/XendRoot.py tools/python/xen/xend/server/netif.py tools/python/xen/xend/server/relocate.py tools/python/xen/xend/tests/test_sxp.py tools/python/xen/xend/uuid.py
line diff
     1.1 --- a/tools/python/xen/xend/XendCheckpoint.py	Wed Nov 30 19:48:21 2005 +0000
     1.2 +++ b/tools/python/xen/xend/XendCheckpoint.py	Wed Nov 30 19:48:54 2005 +0000
     1.3 @@ -18,8 +18,6 @@ import xen.util.auxbin
     1.4  
     1.5  import xen.lowlevel.xc
     1.6  
     1.7 -from xen.xend.xenstore.xsutil import IntroduceDomain
     1.8 -
     1.9  from XendError import XendError
    1.10  from XendLogging import log
    1.11  
     2.1 --- a/tools/python/xen/xend/XendProtocol.py	Wed Nov 30 19:48:21 2005 +0000
     2.2 +++ b/tools/python/xen/xend/XendProtocol.py	Wed Nov 30 19:48:54 2005 +0000
     2.3 @@ -100,7 +100,7 @@ class XendClientProtocol:
     2.4          """
     2.5          return self.xendRequest(url, "POST", args)
     2.6  
     2.7 -    def handleStatus(self, version, status, message):
     2.8 +    def handleStatus(self, _, status, message):
     2.9          """Handle the status returned from the request.
    2.10          """
    2.11          status = int(status)
    2.12 @@ -114,8 +114,8 @@ class XendClientProtocol:
    2.13          """Handle the data returned in response to the request.
    2.14          """
    2.15          if data is None: return None
    2.16 -        type = self.getHeader('Content-Type')
    2.17 -        if type != sxp.mime_type:
    2.18 +        typ = self.getHeader('Content-Type')
    2.19 +        if typ != sxp.mime_type:
    2.20              return data
    2.21          try:
    2.22              pin = sxp.Parser()
    2.23 @@ -205,5 +205,5 @@ class UnixXendClientProtocol(HttpXendCli
    2.24              path = xroot.get_xend_unix_path()
    2.25          self.path = path
    2.26  
    2.27 -    def makeConnection(self, url):
    2.28 +    def makeConnection(self, _):
    2.29          return UnixConnection(self.path)
     3.1 --- a/tools/python/xen/xend/XendRoot.py	Wed Nov 30 19:48:21 2005 +0000
     3.2 +++ b/tools/python/xen/xend/XendRoot.py	Wed Nov 30 19:48:54 2005 +0000
     3.3 @@ -171,7 +171,7 @@ class XendRoot:
     3.4          v = self.get_config_value(name, val)
     3.5          try:
     3.6              return int(v)
     3.7 -        except Exception, ex:
     3.8 +        except Exception:
     3.9              raise XendError("invalid xend config %s: expected int: %s" % (name, v))
    3.10  
    3.11      def get_xend_http_server(self):
     4.1 --- a/tools/python/xen/xend/server/netif.py	Wed Nov 30 19:48:21 2005 +0000
     4.2 +++ b/tools/python/xen/xend/server/netif.py	Wed Nov 30 19:48:54 2005 +0000
     4.3 @@ -71,8 +71,8 @@ class NetifController(DevController):
     4.4          script = os.path.join(xroot.network_script_dir,
     4.5                                sxp.child_value(config, 'script',
     4.6                                                xroot.get_vif_script()))
     4.7 -        type = sxp.child_value(config, 'type')
     4.8 -        if type == 'ioemu':
     4.9 +        typ = sxp.child_value(config, 'type')
    4.10 +        if typ == 'ioemu':
    4.11              return (None,{},{})
    4.12          bridge = sxp.child_value(config, 'bridge')
    4.13          mac    = sxp.child_value(config, 'mac')
     5.1 --- a/tools/python/xen/xend/server/relocate.py	Wed Nov 30 19:48:21 2005 +0000
     5.2 +++ b/tools/python/xen/xend/server/relocate.py	Wed Nov 30 19:48:54 2005 +0000
     5.3 @@ -16,7 +16,6 @@
     5.4  # Copyright (C) 2005 XenSource Ltd
     5.5  #============================================================================
     5.6  
     5.7 -import socket
     5.8  import sys
     5.9  import StringIO
    5.10  
     6.1 --- a/tools/python/xen/xend/tests/test_sxp.py	Wed Nov 30 19:48:21 2005 +0000
     6.2 +++ b/tools/python/xen/xend/tests/test_sxp.py	Wed Nov 30 19:48:54 2005 +0000
     6.3 @@ -6,8 +6,8 @@ import xen.xend.sxp
     6.4  class test_sxp(unittest.TestCase):
     6.5  
     6.6      def testAllFromString(self):
     6.7 -        def t(input, expected):
     6.8 -            self.assertEqual(xen.xend.sxp.all_from_string(input), expected)
     6.9 +        def t(inp, expected):
    6.10 +            self.assertEqual(xen.xend.sxp.all_from_string(inp), expected)
    6.11  
    6.12          t('String',           ['String'])
    6.13          t('(String Thing)',   [['String', 'Thing']])
     7.1 --- a/tools/python/xen/xend/uuid.py	Wed Nov 30 19:48:21 2005 +0000
     7.2 +++ b/tools/python/xen/xend/uuid.py	Wed Nov 30 19:48:54 2005 +0000
     7.3 @@ -25,14 +25,14 @@ import commands
     7.4  import random
     7.5  
     7.6  
     7.7 -def getUuidUuidgen(random = True):
     7.8 +def getUuidUuidgen(randomly = True):
     7.9      """Generate a UUID using the command uuidgen.
    7.10  
    7.11 -    If random is true (default) generates a random uuid.
    7.12 -    If random is false generates a time-based uuid.
    7.13 +    If randomly is true (default) generates a random uuid.
    7.14 +    If randomly is false generates a time-based uuid.
    7.15      """
    7.16      cmd = "uuidgen"
    7.17 -    if random:
    7.18 +    if randomly:
    7.19          cmd += " -r"
    7.20      else:
    7.21          cmd += " -t"
    7.22 @@ -42,7 +42,7 @@ def getUuidUuidgen(random = True):
    7.23  def getUuidRandom():
    7.24      """Generate a random UUID."""
    7.25      
    7.26 -    return [ random.randint(0, 255) for i in range(0, 16) ]
    7.27 +    return [ random.randint(0, 255) for _ in range(0, 16) ]
    7.28  
    7.29  
    7.30  #uuidFactory = getUuidUuidgen