mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
bitkeeper revision 1.1053 (40ed42de9JFsw0T591T5jpnZ82grCw)
Quieten down debug and errors.
This commit is contained in:
1 parent
2224656b17
commit
b54bec0789
11 files changed
+32
-21
No files matched your search
@@ -19,6 +19,9 @@ import PrettyPrint
|
||||
|
||||
DEBUG = 0
|
||||
|
||||
class XendError(RuntimeError):
|
||||
pass
|
||||
|
||||
class Foo(httplib.HTTPResponse):
|
||||
|
||||
def begin(self):
|
||||
@@ -118,7 +121,7 @@ def xend_request(url, method, data=None):
|
||||
if resp.status in [204, 404]:
|
||||
return None
|
||||
if resp.status not in [200, 201, 202, 203]:
|
||||
raise RuntimeError(resp.reason)
|
||||
raise XendError(resp.reason)
|
||||
pin = sxp.Parser()
|
||||
data = resp.read()
|
||||
if DEBUG: print "***data" , data
|
||||
|
||||
@@ -8,7 +8,7 @@ import sys
|
||||
import traceback
|
||||
|
||||
from twisted.internet import defer
|
||||
defer.Deferred.debug = 1
|
||||
#defer.Deferred.debug = 1
|
||||
from twisted.internet import reactor
|
||||
|
||||
import xen.lowlevel.xc; xc = xen.lowlevel.xc.new()
|
||||
|
||||
@@ -15,7 +15,7 @@ import sys
|
||||
import os
|
||||
|
||||
from twisted.internet import defer
|
||||
defer.Deferred.debug = 1
|
||||
#defer.Deferred.debug = 1
|
||||
|
||||
import xen.lowlevel.xc; xc = xen.lowlevel.xc.new()
|
||||
import xen.util.ip
|
||||
|
||||
@@ -6,7 +6,7 @@ import time
|
||||
|
||||
from twisted.internet import reactor
|
||||
from twisted.internet import defer
|
||||
defer.Deferred.debug = 1
|
||||
#defer.Deferred.debug = 1
|
||||
from twisted.internet.protocol import Protocol
|
||||
from twisted.internet.protocol import ClientFactory
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import types
|
||||
import StringIO
|
||||
|
||||
from twisted.internet import defer
|
||||
defer.Deferred.debug = 1
|
||||
#defer.Deferred.debug = 1
|
||||
from twisted.internet import reactor
|
||||
from twisted.web import error
|
||||
from twisted.web import resource
|
||||
|
||||
@@ -23,7 +23,7 @@ from twisted.internet import reactor
|
||||
from twisted.internet import protocol
|
||||
from twisted.internet import abstract
|
||||
from twisted.internet import defer
|
||||
defer.Deferred.debug = 1
|
||||
#defer.Deferred.debug = 1
|
||||
|
||||
from xen.lowlevel import xu
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ class SrvDomainDir(SrvDir):
|
||||
except Exception, ex:
|
||||
print 'op_create> Exception creating domain:'
|
||||
traceback.print_exc()
|
||||
req.setResponseCode(http.BAD_REQUEST, "Error creating domain")
|
||||
req.setResponseCode(http.BAD_REQUEST, "Error creating domain: " + str(ex))
|
||||
return str(ex)
|
||||
#return error.ErrorPage(http.BAD_REQUEST,
|
||||
# "Error creating domain",
|
||||
@@ -100,7 +100,7 @@ class SrvDomainDir(SrvDir):
|
||||
"""Callback to handle errors in deferred domain creation.
|
||||
"""
|
||||
print 'op_create> Deferred Exception creating domain:', err
|
||||
req.setResponseCode(http.BAD_REQUEST, "Error creating domain")
|
||||
req.setResponseCode(http.BAD_REQUEST, "Error creating domain: " + str(err))
|
||||
return str(err)
|
||||
|
||||
def op_restore(self, op, req):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
|
||||
|
||||
from twisted.internet import defer
|
||||
defer.Deferred.debug = 1
|
||||
#defer.Deferred.debug = 1
|
||||
|
||||
from xen.xend import sxp
|
||||
from xen.xend import PrettyPrint
|
||||
|
||||
@@ -4,7 +4,7 @@ for a domain.
|
||||
"""
|
||||
|
||||
from twisted.internet import defer
|
||||
defer.Deferred.debug = 1
|
||||
#defer.Deferred.debug = 1
|
||||
|
||||
import channel
|
||||
from messages import msgTypeName, printMsg
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import random
|
||||
|
||||
from twisted.internet import defer
|
||||
defer.Deferred.debug = 1
|
||||
#defer.Deferred.debug = 1
|
||||
|
||||
from xen.xend import sxp
|
||||
from xen.xend import PrettyPrint
|
||||
|
||||
@@ -7,7 +7,7 @@ import sys
|
||||
|
||||
from xen.xend import sxp
|
||||
from xen.xend import PrettyPrint
|
||||
from xen.xend.XendClient import server
|
||||
from xen.xend.XendClient import server, XendError
|
||||
|
||||
from xen.util import console_client
|
||||
|
||||
@@ -352,13 +352,21 @@ def preprocess(opts, vals):
|
||||
|
||||
def make_domain(opts, config):
|
||||
"""Create, build and start a domain.
|
||||
Returns: pair: [int] the ID of the new domain, [int] console port
|
||||
|
||||
@param opts: options
|
||||
@param config: configuration
|
||||
@return: domain id, console port
|
||||
@rtype: (int, int)
|
||||
"""
|
||||
if opts.vals.load:
|
||||
filename = os.path.abspath(opts.vals.load)
|
||||
dominfo = server.xend_domain_restore(filename, config)
|
||||
else:
|
||||
dominfo = server.xend_domain_create(config)
|
||||
|
||||
try:
|
||||
if opts.vals.load:
|
||||
filename = os.path.abspath(opts.vals.load)
|
||||
dominfo = server.xend_domain_restore(filename, config)
|
||||
else:
|
||||
dominfo = server.xend_domain_create(config)
|
||||
except XendError, ex:
|
||||
opts.err(str(ex))
|
||||
|
||||
dom = int(sxp.child_value(dominfo, 'id'))
|
||||
console_info = sxp.child(dominfo, 'console')
|
||||
@@ -369,7 +377,7 @@ def make_domain(opts, config):
|
||||
|
||||
if server.xend_domain_unpause(dom) < 0:
|
||||
server.xend_domain_destroy(dom)
|
||||
opts.err("Failed to start domain %d" % dom)
|
||||
opts.err("Failed to unpause domain %d" % dom)
|
||||
opts.info("Started domain %d, console on port %d"
|
||||
% (dom, console_port))
|
||||
return (dom, console_port)
|
||||
@@ -397,9 +405,9 @@ def main(argv):
|
||||
if opts.vals.dryrun:
|
||||
PrettyPrint.prettyprint(config)
|
||||
else:
|
||||
(d, c) = make_domain(opts, config)
|
||||
(dom, console) = make_domain(opts, config)
|
||||
if opts.vals.console_autoconnect:
|
||||
console_client.connect('localhost', c)
|
||||
console_client.connect('localhost', console)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(sys.argv)
|
||||