From: Keir Fraser Date: Mon, 14 Dec 2009 07:59:12 +0000 (+0000) Subject: xend: fix empty 'cpus' parsing X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~12907 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a4a7c638f78e50b0e90dffef5792fde591d5712f;p=xen.git 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 --- 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('-')