From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [Xen-changelog] Added exception handler for ProtocolError. Date: Thu, 23 Mar 2006 10:24:42 -0600 Message-ID: <4422CBCA.5080204@us.ibm.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: xen-changelog@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Xen patchbot -unstable wrote: > # HG changeset patch > # User emellor@leeni.uk.xensource.com > # Node ID c1bb4eb565296bdb00aed84fcc877befbcebd8e9 > # Parent b55ca95fdc846a5db9f30ba1c5d065fe898f88e7 > Added exception handler for ProtocolError. > > Signed-off-by: Ewan Mellor > > diff -r b55ca95fdc84 -r c1bb4eb56529 tools/python/xen/xm/main.py > --- a/tools/python/xen/xm/main.py Thu Mar 23 10:55:56 2006 > +++ b/tools/python/xen/xm/main.py Thu Mar 23 10:58:19 2006 > @@ -1102,6 +1102,12 @@ > else: > err("Error connecting to xend: %s." % ex[1]) > sys.exit(1) > + except xmlrpclib.ProtocolError, ex: > + if os.geteuid() != 0: > + err("Most commands need root access. Please try again as root.") > + else: > + err("Error connecting to xend: %s." % ex.errmsg) > + sys.exit(1) > except SystemExit: > sys.exit(1) > except xmlrpclib.Fault, ex: > Hi Ewan, ProtocolError's shouldn't happen. The case where os.geteuid() != 0 is a possibility (although I thought we had a check earlier for that?). However, if we are getting them for another reason, something's wrong. What commands were you seeing this with? There may be a latent bug in the dispatch code that marshals exceptions... Regards, Anthony Liguori > _______________________________________________ > Xen-changelog mailing list > Xen-changelog@lists.xensource.com > http://lists.xensource.com/xen-changelog >