From a4a7c638f78e50b0e90dffef5792fde591d5712f Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Mon, 14 Dec 2009 07:59:12 +0000 Subject: [PATCH] xend: fix empty 'cpus' parsing /etc/xen/xmexample.hvm says "" means "leave to Xen to pick", but we get a "Error: string index out of range" currently. Signed-off-by: Dexuan Cui --- tools/python/xen/xend/XendConfig.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py index a79dfe5864..7869611e87 100644 --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -577,6 +577,8 @@ class XendConfig(dict): # "0-3,^1" -> [0,2,3] # "0-3,^1,1" -> [0,1,2,3] l = [] + if s == "": + return l for c in s.split(','): if c.find('-') != -1: (x, y) = c.split('-') -- 2.30.2