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 <dexuan.cui@intel.com>
This commit is contained in:
Keir Fraser committed 2009-12-14 07:59:12 +00:00
1 parent 51dfdb01ad
commit a4a7c638f7
1 file changed
+2
+2
View File
@@ -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('-')
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.