From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Novotny Subject: Re: [PATCH] pyGrub: Implement error handling on kernel/initrd extraction Date: Tue, 27 Jul 2010 10:49:03 +0200 Message-ID: <4C4E9D7F.1020008@redhat.com> References: <4C4D94D8.3040609@redhat.com> <19533.43140.441316.310245@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <19533.43140.441316.310245@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson Cc: "'xen-devel@lists.xensource.com'" List-Id: xen-devel@lists.xenproject.org On 07/26/2010 05:23 PM, Ian Jackson wrote: > Michal Novotny writes ("[Xen-devel] [PATCH] pyGrub: Implement error handling on kernel/initrd extraction"): > >> Since we agreed that introduction of dom0-min-space is not the right way >> to go, it's superseeded by this patch. >> > ... > >> - os.write(tfd, data) >> - os.close(tfd) >> + try: >> + os.write(tfd, data) >> + os.close(tfd) >> + except OSError, e: >> + print>>sys.stderr, "pyGrub: %s" % str(e) >> + sys.exit(1) >> > Thanks, but this is not even slightly correct. > > Ian. > Why not? It's been tested and working fine. The try/except block is working fine and sys.exit(1) is necessary to terminate pyGrub. Michal -- Michal Novotny, RHCE Virtualization Team (xen userspace), Red Hat