diff options
| author | Christian Berendt <berendt@b1-systems.de> | 2011-03-16 10:58:02 +0100 |
|---|---|---|
| committer | Christian Berendt <berendt@b1-systems.de> | 2011-03-16 10:58:02 +0100 |
| commit | ba35831c1f66c424e9495642ba23e9d2742a339e (patch) | |
| tree | 41ea8700315bde57ad10bcaa5cdcd74981460fb4 /nova | |
| parent | 5da32f8b917d461388d0186af52946a3f7d2c665 (diff) | |
| download | nova-ba35831c1f66c424e9495642ba23e9d2742a339e.tar.gz nova-ba35831c1f66c424e9495642ba23e9d2742a339e.tar.xz nova-ba35831c1f66c424e9495642ba23e9d2742a339e.zip | |
added correct path to cpu information (tested on a system with 1 installed cpu package)
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/virt/libvirt_conn.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/nova/virt/libvirt_conn.py b/nova/virt/libvirt_conn.py index 7994e9547..9943b742a 100644 --- a/nova/virt/libvirt_conn.py +++ b/nova/virt/libvirt_conn.py @@ -984,18 +984,18 @@ class LibvirtConnection(object): xml = self._conn.getCapabilities() xml = libxml2.parseDoc(xml) - nodes = xml.xpathEval('//cpu') + nodes = xml.xpathEval('//host/cpu') if len(nodes) != 1: raise exception.Invalid(_("Invalid xml. '<cpu>' must be 1," "but %d\n") % len(nodes) + xml.serialize()) cpu_info = dict() - cpu_info['arch'] = xml.xpathEval('//cpu/arch')[0].getContent() - cpu_info['model'] = xml.xpathEval('//cpu/model')[0].getContent() - cpu_info['vendor'] = xml.xpathEval('//cpu/vendor')[0].getContent() + cpu_info['arch'] = xml.xpathEval('//host/cpu/arch')[0].getContent() + cpu_info['model'] = xml.xpathEval('//host/cpu/model')[0].getContent() + cpu_info['vendor'] = xml.xpathEval('//host/cpu/vendor')[0].getContent() - topology_node = xml.xpathEval('//cpu/topology')[0].get_properties() + topology_node = xml.xpathEval('//host/cpu/topology')[0].get_properties() topology = dict() while topology_node != None: name = topology_node.get_name() @@ -1009,7 +1009,7 @@ class LibvirtConnection(object): raise exception.Invalid(_("Invalid xml: topology(%(topology)s) " "must have %(ks)s") % locals()) - feature_nodes = xml.xpathEval('//cpu/feature') + feature_nodes = xml.xpathEval('//host/cpu/feature') features = list() for nodes in feature_nodes: features.append(nodes.get_properties().getContent()) |
