packages: xen/xend.catchbt.patch (NEW)=?UTF-8?Q?=20?=- catch connection and log file errors

baggins baggins at pld-linux.org
Wed Feb 29 22:03:17 CET 2012


Author: baggins                      Date: Wed Feb 29 21:03:17 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- catch connection and log file errors

---- Files affected:
packages/xen:
   xend.catchbt.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/xen/xend.catchbt.patch
diff -u /dev/null packages/xen/xend.catchbt.patch:1.1
--- /dev/null	Wed Feb 29 22:03:17 2012
+++ packages/xen/xend.catchbt.patch	Wed Feb 29 22:03:12 2012
@@ -0,0 +1,30 @@
+--- xen-4.1.2/tools/python/xen/xend/image.py.orig	2011-10-20 18:05:44.000000000 +0100
++++ xen-4.1.2/tools/python/xen/xend/image.py	2011-11-20 20:41:10.730905790 +0000
+@@ -43,7 +43,11 @@
+ from xen.util import utils
+ from xen.xend import osdep
+ 
+-xc = xen.lowlevel.xc.xc()
++try:
++    xc = xen.lowlevel.xc.xc()
++except Exception:
++    print >>sys.stderr, ('xend/image.py: Error connecting to hypervisor')
++    os._exit(1)
+ 
+ MAX_GUEST_CMDLINE = 1024
+ 
+--- xen-4.1.2/tools/python/xen/xend/XendLogging.py.orig	2011-10-20 18:05:44.000000000 +0100
++++ xen-4.1.2/tools/python/xen/xend/XendLogging.py	2012-01-10 21:27:57.304916048 +0000
+@@ -132,7 +132,11 @@
+         fileHandler = openFileHandler(filename)
+         logfilename = filename
+     except IOError:
+-        logfilename = tempfile.mkstemp("-xend.log")[1]
++        try:
++            logfilename = tempfile.mkstemp("-xend.log")[1]
++        except IOError:
++            print >>sys.stderr, ('xend/XendLogging.py: Unable to open standard or temporary log file for xend')
++            os._exit(1)
+         fileHandler = openFileHandler(logfilename)
+ 
+     fileHandler.setFormatter(logging.Formatter(LOGFILE_FORMAT, DATE_FORMAT))
================================================================


More information about the pld-cvs-commit mailing list