Miscellaneous tidying up, no semantic changes.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
emellor@leeni.uk.xensource.com committed 2005-11-30 19:48:54 +00:00
1 parent 3fba743862
commit a0c858f6bf
7 files changed
+14 -17

No files matched your search

-2
View File
@@ -18,8 +18,6 @@ import xen.util.auxbin
import xen.lowlevel.xc
from xen.xend.xenstore.xsutil import IntroduceDomain
from XendError import XendError
from XendLogging import log
+4 -4
View File
@@ -100,7 +100,7 @@ class XendClientProtocol:
"""
return self.xendRequest(url, "POST", args)
def handleStatus(self, version, status, message):
def handleStatus(self, _, status, message):
"""Handle the status returned from the request.
"""
status = int(status)
@@ -114,8 +114,8 @@ class XendClientProtocol:
"""Handle the data returned in response to the request.
"""
if data is None: return None
type = self.getHeader('Content-Type')
if type != sxp.mime_type:
typ = self.getHeader('Content-Type')
if typ != sxp.mime_type:
return data
try:
pin = sxp.Parser()
@@ -205,5 +205,5 @@ class UnixXendClientProtocol(HttpXendClientProtocol):
path = xroot.get_xend_unix_path()
self.path = path
def makeConnection(self, url):
def makeConnection(self, _):
return UnixConnection(self.path)
+1 -1
View File
@@ -171,7 +171,7 @@ class XendRoot:
v = self.get_config_value(name, val)
try:
return int(v)
except Exception, ex:
except Exception:
raise XendError("invalid xend config %s: expected int: %s" % (name, v))
def get_xend_http_server(self):
+2 -2
View File
@@ -71,8 +71,8 @@ class NetifController(DevController):
script = os.path.join(xroot.network_script_dir,
sxp.child_value(config, 'script',
xroot.get_vif_script()))
type = sxp.child_value(config, 'type')
if type == 'ioemu':
typ = sxp.child_value(config, 'type')
if typ == 'ioemu':
return (None,{},{})
bridge = sxp.child_value(config, 'bridge')
mac = sxp.child_value(config, 'mac')
-1
View File
@@ -16,7 +16,6 @@
# Copyright (C) 2005 XenSource Ltd
#============================================================================
import socket
import sys
import StringIO
+2 -2
View File
@@ -6,8 +6,8 @@ import xen.xend.sxp
class test_sxp(unittest.TestCase):
def testAllFromString(self):
def t(input, expected):
self.assertEqual(xen.xend.sxp.all_from_string(input), expected)
def t(inp, expected):
self.assertEqual(xen.xend.sxp.all_from_string(inp), expected)
t('String', ['String'])
t('(String Thing)', [['String', 'Thing']])
+5 -5
View File
@@ -25,14 +25,14 @@ import commands
import random
def getUuidUuidgen(random = True):
def getUuidUuidgen(randomly = True):
"""Generate a UUID using the command uuidgen.
If random is true (default) generates a random uuid.
If random is false generates a time-based uuid.
If randomly is true (default) generates a random uuid.
If randomly is false generates a time-based uuid.
"""
cmd = "uuidgen"
if random:
if randomly:
cmd += " -r"
else:
cmd += " -t"
@@ -42,7 +42,7 @@ def getUuidUuidgen(random = True):
def getUuidRandom():
"""Generate a random UUID."""
return [ random.randint(0, 255) for i in range(0, 16) ]
return [ random.randint(0, 255) for _ in range(0, 16) ]
#uuidFactory = getUuidUuidgen
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.