Print error messages to stderr. Remove unused handle_xend_error.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
emellor@leeni.uk.xensource.com committed 2006-03-31 00:14:09 +01:00
1 parent 8d3271b7cc
commit 6b914525af
1 file changed
+3 -14
+3 -14
View File
@@ -291,18 +291,6 @@ def int_unit(str, dest):
def err(msg):
print >>sys.stderr, "Error:", msg
def handle_xend_error(cmd, args, ex):
non_option = filter(lambda x: x[0] != '-', args)
dom = len(non_option) > 0 and non_option[0] or None
error = str(ex)
if error == "Not found" and dom != None:
err("Domain '%s' not found when running 'xm %s'" % (dom, cmd))
else:
err(error)
sys.exit(1)
#########################################################################
#
@@ -1106,9 +1094,10 @@ def main(argv=sys.argv):
sys.exit(1)
except xmlrpclib.Fault, ex:
if ex.faultCode == xen.xend.XendClient.ERROR_INVALID_DOMAIN:
print "Error: the domain '%s' does not exist." % ex.faultString
print >>sys.stderr, (
"Error: the domain '%s' does not exist." % ex.faultString)
else:
print "Error: %s" % ex.faultString
print >>sys.stderr, "Error: %s" % ex.faultString
sys.exit(1)
except:
print "Unexpected error:", sys.exc_info()[0]
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.