mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
merge?
This commit is contained in:
commit
460d77e2da
6 files changed
+37
-9
No files matched your search
@@ -81,7 +81,14 @@ class SrvBase(resource.Resource):
|
||||
req.write("Operation not implemented: " + op)
|
||||
return ''
|
||||
else:
|
||||
return op_method(op, req)
|
||||
try:
|
||||
res = op_method(op, req)
|
||||
except Exception, exn:
|
||||
log.exception("Request %s failed.", op)
|
||||
if req.useSxp():
|
||||
return ['xend.err', "Exception: " + str(exn)]
|
||||
else:
|
||||
return "<p>%s</p>" % str(exn)
|
||||
|
||||
def print_path(self, req):
|
||||
"""Print the path with hyperlinks.
|
||||
|
||||
@@ -547,6 +547,7 @@ class XendDomain:
|
||||
except XendError:
|
||||
raise
|
||||
except Exception, exn:
|
||||
log.exception("")
|
||||
raise XendError(str(exn))
|
||||
|
||||
|
||||
|
||||
@@ -615,7 +615,7 @@ class XendDomainInfo:
|
||||
if not reason in shutdown_reasons.values():
|
||||
raise XendError('invalid reason:' + reason)
|
||||
self.storeVm("control/shutdown", reason)
|
||||
if not reason in ['suspend']:
|
||||
if not reason == 'suspend':
|
||||
self.storeVm('xend/shutdown_start_time', time.time())
|
||||
|
||||
|
||||
|
||||
@@ -152,11 +152,11 @@ class SrvDomainDir(SrvDir):
|
||||
domains = self.xd.list_sorted()
|
||||
req.write('<ul>')
|
||||
for d in domains:
|
||||
req.write('<li><a href="%s%s"> Domain %s</a>'
|
||||
% (url, d.getName(), d.getName()))
|
||||
req.write('id=%s' % d.getDomain())
|
||||
req.write('memory=%d'% d.getMemoryTarget())
|
||||
req.write('ssidref=%d'% d.getSsidref())
|
||||
req.write(
|
||||
'<li><a href="%s%s">Domain %s</a>: id = %s, memory = %d, '
|
||||
'ssidref = %d.'
|
||||
% (url, d.getName(), d.getName(), d.getDomid(),
|
||||
d.getMemoryTarget(), d.getSsidref()))
|
||||
req.write('</li>')
|
||||
req.write('</ul>')
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ class SrvNode(SrvDir):
|
||||
for d in self.info():
|
||||
req.write('<li> %10s: %s' % (d[0], str(d[1])))
|
||||
req.write('<li><a href="%sdmesg">Xen dmesg output</a>' % url)
|
||||
req.write('<li><a href="%slog>Xend log</a>' % url)
|
||||
req.write('<li><a href="%slog">Xend log</a>' % url)
|
||||
req.write('</ul>')
|
||||
req.write('</body></html>')
|
||||
|
||||
|
||||
@@ -42,8 +42,15 @@ class xstransact:
|
||||
'%s, while reading %s' % (ex.args[1], path))
|
||||
|
||||
def read(self, *args):
|
||||
"""If no arguments are given, return the value at this transaction's
|
||||
path. If one argument is given, treat that argument as a subpath to
|
||||
this transaction's path, and return the value at that path.
|
||||
Otherwise, treat each argument as a subpath to this transaction's
|
||||
path, and return a list composed of the values at each of those
|
||||
instead.
|
||||
"""
|
||||
if len(args) == 0:
|
||||
raise TypeError
|
||||
return xshandle().read(self.path)
|
||||
if len(args) == 1:
|
||||
return self._read(args[0])
|
||||
ret = []
|
||||
@@ -191,6 +198,13 @@ class xstransact:
|
||||
|
||||
|
||||
def Read(cls, path, *args):
|
||||
"""If only one argument is given (path), return the value stored at
|
||||
that path. If two arguments are given, treat the second argument as a
|
||||
subpath within the first, and return the value at the composed path.
|
||||
Otherwise, treat each argument after the first as a subpath to the
|
||||
given path, and return a list composed of the values at each of those
|
||||
instead. This operation is performed inside a transaction.
|
||||
"""
|
||||
while True:
|
||||
t = cls(path)
|
||||
try:
|
||||
@@ -234,6 +248,12 @@ class xstransact:
|
||||
Remove = classmethod(Remove)
|
||||
|
||||
def List(cls, path, *args):
|
||||
"""If no arguments are given (path), list its contents, returning the
|
||||
entries therein, or None if no entries are found. Otherwise, treat
|
||||
each further argument as a subpath to the given path, and return the
|
||||
cumulative listing of each of those instead. This operation is
|
||||
performed inside a transaction.
|
||||
"""
|
||||
while True:
|
||||
t = cls(path)
|
||||
try:
|
||||
|
||||