mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
python: Remove tab indents.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
This commit is contained in:
1 parent
55eb5c4259
commit
063aa7f823
10 files changed
+44
-45
No files matched your search
@@ -30,7 +30,7 @@ import httpserver
|
||||
|
||||
def uri_pathlist(p):
|
||||
"""Split a path into a list.
|
||||
p path
|
||||
p path
|
||||
return list of path elements
|
||||
"""
|
||||
l = []
|
||||
@@ -51,7 +51,7 @@ class SrvBase(resource.Resource):
|
||||
"""Get the method for an operation.
|
||||
For operation 'foo' looks for 'op_foo'.
|
||||
|
||||
op operation name
|
||||
op operation name
|
||||
returns method or None
|
||||
"""
|
||||
op_method_name = 'op_' + op
|
||||
@@ -67,7 +67,7 @@ class SrvBase(resource.Resource):
|
||||
and an HTML string otherwise (or list).
|
||||
Methods may also return a ThreadRequest (for incomplete processing).
|
||||
|
||||
req request
|
||||
req request
|
||||
"""
|
||||
op = req.args.get('op')
|
||||
if op is None or len(op) != 1:
|
||||
|
||||
@@ -37,7 +37,7 @@ class SrvConstructor:
|
||||
"""Create a constructor. It is assumed that the class
|
||||
should be imported as 'from xen.xend.server.klass import klass'.
|
||||
|
||||
klass name of its class
|
||||
klass name of its class
|
||||
"""
|
||||
self.klass = klass
|
||||
self.obj = None
|
||||
|
||||
@@ -284,9 +284,9 @@ class SXPPrettyPrinter(PrettyPrinter):
|
||||
def prettyprint(sxpr, out=sys.stdout, width=80):
|
||||
"""Prettyprint an SXP form.
|
||||
|
||||
sxpr s-expression
|
||||
out destination
|
||||
width maximum output width
|
||||
sxpr s-expression
|
||||
out destination
|
||||
width maximum output width
|
||||
"""
|
||||
if isinstance(sxpr, types.ListType):
|
||||
pp = SXPPrettyPrinter(width=width)
|
||||
@@ -299,8 +299,8 @@ def prettyprint(sxpr, out=sys.stdout, width=80):
|
||||
def prettyprintstring(sxpr, width=80):
|
||||
"""Prettyprint an SXP form to a string.
|
||||
|
||||
sxpr s-expression
|
||||
width maximum output width
|
||||
sxpr s-expression
|
||||
width maximum output width
|
||||
"""
|
||||
io = StringIO.StringIO()
|
||||
prettyprint(sxpr, out=io, width=width)
|
||||
|
||||
@@ -1437,20 +1437,20 @@ class XendConfig(dict):
|
||||
if dev_uuid not in target['console_refs']:
|
||||
target['console_refs'].append(dev_uuid)
|
||||
|
||||
# Cope with old-format save files which say under vfb
|
||||
# (type vfb) rather than (vfb 1)
|
||||
try:
|
||||
vfb_type = dev_info['type']
|
||||
except KeyError:
|
||||
vfb_type = None
|
||||
log.debug("iwj dev_type=%s vfb type %s" %
|
||||
(dev_type, `vfb_type`))
|
||||
# Cope with old-format save files which say under vfb
|
||||
# (type vfb) rather than (vfb 1)
|
||||
try:
|
||||
vfb_type = dev_info['type']
|
||||
except KeyError:
|
||||
vfb_type = None
|
||||
log.debug("iwj dev_type=%s vfb type %s" %
|
||||
(dev_type, `vfb_type`))
|
||||
|
||||
if vfb_type == 'vnc' or vfb_type == 'sdl':
|
||||
dev_info[vfb_type] = 1
|
||||
del dev_info['type']
|
||||
log.debug("iwj dev_type=%s vfb setting dev_info['%s']" %
|
||||
(dev_type, vfb_type))
|
||||
if vfb_type == 'vnc' or vfb_type == 'sdl':
|
||||
dev_info[vfb_type] = 1
|
||||
del dev_info['type']
|
||||
log.debug("iwj dev_type=%s vfb setting dev_info['%s']" %
|
||||
(dev_type, vfb_type))
|
||||
# Create serial backends now, the location value is bogus, but does not matter
|
||||
i=0
|
||||
chardev=0
|
||||
|
||||
@@ -97,7 +97,7 @@ def encode_data(d):
|
||||
"""Encode some data for HTTP transport.
|
||||
The encoding used is stored in 'Content-Type' in the headers.
|
||||
|
||||
d data - sequence of tuples or dictionary
|
||||
d data - sequence of tuples or dictionary
|
||||
returns a 2-tuple of the headers and the encoded data
|
||||
"""
|
||||
val = ({}, None)
|
||||
|
||||
@@ -72,12 +72,11 @@ def _linux_balloon_stat_sysfs(label):
|
||||
return None
|
||||
|
||||
def _linux_balloon_stat(label):
|
||||
if os.access(PROC_XEN_BALLOON, os.F_OK):
|
||||
return _linux_balloon_stat_proc(label)
|
||||
elif os.access(SYSFS_XEN_MEMORY, os.F_OK):
|
||||
return _linux_balloon_stat_sysfs(label)
|
||||
|
||||
return None
|
||||
if os.access(PROC_XEN_BALLOON, os.F_OK):
|
||||
return _linux_balloon_stat_proc(label)
|
||||
elif os.access(SYSFS_XEN_MEMORY, os.F_OK):
|
||||
return _linux_balloon_stat_sysfs(label)
|
||||
return None
|
||||
|
||||
def _solaris_balloon_stat(label):
|
||||
"""Returns the value for the named label, or None if an error occurs."""
|
||||
|
||||
@@ -37,10 +37,10 @@ class PCIQuirk:
|
||||
if id.startswith(self.devid[:9]): # id's vendor and device ID match
|
||||
skey = id.split(':')
|
||||
size = len(skey)
|
||||
if (size == 2): # subvendor/subdevice not suplied
|
||||
if (size == 2): # subvendor/subdevice not suplied
|
||||
ret = True
|
||||
break
|
||||
elif (size == 4): # check subvendor/subdevice
|
||||
elif (size == 4): # check subvendor/subdevice
|
||||
# check subvendor
|
||||
subven = '%04x' % self.subvendor
|
||||
if ((skey[2] != 'FFFF') and
|
||||
|
||||
@@ -730,7 +730,7 @@ def all_from_string(s):
|
||||
def parse(io):
|
||||
"""Completely parse all input from 'io'.
|
||||
|
||||
io input file object
|
||||
io input file object
|
||||
returns list of values, None if incomplete
|
||||
raises ParseError on parse error
|
||||
"""
|
||||
|
||||
@@ -367,7 +367,7 @@ gopts.var('vfb', val="vnc=1,sdl=1,vncunused=1,vncdisplay=N,vnclisten=ADDR,displa
|
||||
given DISPLAY and XAUTHORITY, which default to the current user's
|
||||
ones. OpenGL will be used by default unless opengl is set to 0.
|
||||
keymap overrides the XendD configured default layout file.
|
||||
Serial adds a second serial support to qemu.
|
||||
Serial adds a second serial support to qemu.
|
||||
Monitor adds a backend for the stubdom monitor.""")
|
||||
|
||||
gopts.var('vif', val="type=TYPE,mac=MAC,bridge=BRIDGE,ip=IPADDR,script=SCRIPT," + \
|
||||
|
||||
+12
-12
@@ -1794,8 +1794,8 @@ def xm_console(args):
|
||||
for (k, v) in options:
|
||||
if k in ['-q', '--quiet']:
|
||||
quiet = True
|
||||
elif k in ['-n', '--num']:
|
||||
num = int(v[0])
|
||||
elif k in ['-n', '--num']:
|
||||
num = int(v[0])
|
||||
else:
|
||||
assert False
|
||||
|
||||
@@ -2227,15 +2227,15 @@ def xm_pci_list(args):
|
||||
return
|
||||
|
||||
def f(x):
|
||||
# The vfunc shouldn't be used for ordering if the vslot hasn't been
|
||||
# assigned as the output looks odd beacuse the vfunc isn't reported
|
||||
# but the (physical) function is.
|
||||
if x['vdevfn'] & AUTO_PHP_SLOT:
|
||||
vdevfn = AUTO_PHP_SLOT
|
||||
else:
|
||||
vdevfn = x['vdevfn']
|
||||
return (vdevfn << 32) | \
|
||||
PCI_BDF(x['domain'], x['bus'], x['slot'], x['func'])
|
||||
# The vfunc shouldn't be used for ordering if the vslot hasn't been
|
||||
# assigned as the output looks odd beacuse the vfunc isn't reported
|
||||
# but the (physical) function is.
|
||||
if x['vdevfn'] & AUTO_PHP_SLOT:
|
||||
vdevfn = AUTO_PHP_SLOT
|
||||
else:
|
||||
vdevfn = x['vdevfn']
|
||||
return (vdevfn << 32) | \
|
||||
PCI_BDF(x['domain'], x['bus'], x['slot'], x['func'])
|
||||
devs.sort(None, f)
|
||||
|
||||
has_vdevfn = False
|
||||
@@ -2561,7 +2561,7 @@ def xm_pci_attach(args):
|
||||
vslot = PCI_SLOT(vdevfn)
|
||||
for i in dev:
|
||||
i['vdevfn'] = '0x%02x' % \
|
||||
PCI_DEVFN(vslot, PCI_FUNC(int(i['vdevfn'], 16)))
|
||||
PCI_DEVFN(vslot, PCI_FUNC(int(i['vdevfn'], 16)))
|
||||
|
||||
for i in dev:
|
||||
xm_pci_attach_one(dom, i)
|
||||
|
||||