Merge lp:~berendt/nova/lp735298 into lp:~hudson-openstack/nova/trunk

Proposed by Christian Berendt
Status: Merged
Approved by: Rick Harris
Approved revision: 804
Merged at revision: 813
Proposed branch: lp:~berendt/nova/lp735298
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 37 lines (+7/-6)
1 file modified
nova/virt/libvirt_conn.py (+7/-6)
To merge this branch: bzr merge lp:~berendt/nova/lp735298
Reviewer Review Type Date Requested Status
Rick Harris (community) Approve
Jay Pipes (community) Approve
Devin Carlen (community) Approve
Kei Masumoto (community) Approve
Review via email: mp+53594@code.launchpad.net

Commit message

fixes bug 735298: start of nova-compute not possible because of wrong xml paths to the //host/cpu section in "virsh capabilities", used in nova/virt/libvirt_conn.py

Description of the change

fixes bug 735298: start of nova-compute not possible because of wrong xml paths to the //host/cpu section in "virsh capabilities", used in nova/virt/libvirt_conn.py

To post a comment you must log in.
Revision history for this message
Kei Masumoto (masumotok) wrote :

I think this change is good. thank you!

review: Approve
Revision history for this message
Christian Berendt (berendt) wrote :

tested with bzr rev 802 using libvirt 0.8.8 on a system with 1 installed cpu package (4 cores). for the output of "virsh compabilities" of a system with 2 installed cpu packages (2 cores each one) please check bug 735298. i didn't test the patch on this system, but it should work there, too, because the object //host/cpu is unique in the output.

Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
Jay Pipes (jaypipes) wrote :

lgtm.

review: Approve
Revision history for this message
Rick Harris (rconradharris) wrote :

lgtm

review: Approve
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Download full text (30.5 KiB)

The attempt to merge lp:~berendt/nova/lp735298 into lp:nova failed. Below is the output from the failed tests.

AccountsTest
    test_account_create OK
    test_account_delete OK
    test_account_update OK
    test_get_account OK
AdminAPITest
    test_admin_disabled OK
    test_admin_enabled OK
APITest
    test_exceptions_are_converted_to_faults OK
Test
    test_authorize_token OK
    test_authorize_user OK
    test_bad_token OK
    test_bad_user_bad_key OK
    test_bad_user_good_key OK
    test_no_user OK
    test_token_expiry OK
TestFunctional
    test_token_doesnotexist OK
    test_token_expiry OK
TestLimiter
    test_authorize_token OK
LimiterTest
    test_limiter_custom_max_limit OK
    test_limiter_limit_and_offset OK
    test_limiter_limit_medium OK
    test_limiter_limit_over_max OK
    test_limiter_limit_zero OK
    test_limiter_negative_limit OK
    test_limiter_negative_offset OK
    test_limiter_nothing OK
    test_limiter_offset_bad OK
    test_limiter_offset_blank OK
    test_limiter_offset_medium OK
    test_limiter_offset_over_max OK
    test_limiter_offset_zero OK
TestFaults
    test_fault_parts OK
    test_raise OK
    test_retry_header OK
FlavorsTest
    test_get_flavor_by_id OK
    test_get_flavor_list OK
GlanceImageServiceTest
    test_create OK
    test_create_and_show_non_existing_image OK
    test_delete OK
    test_update OK
ImageControllerWithGlanceServiceTest
    test_get_image_details OK
    test_get_image_index OK
LocalImageServiceTest
    test_create OK
    test_create_and_show_non_existing_image OK
    test_delete ...

Revision history for this message
Christian Berendt (berendt) wrote :

fixed pep8 issue, it should be possible to merge now without problems. sorry for the fleabite.

Revision history for this message
Rick Harris (rconradharris) wrote :

Thanks Christian. Re-approving.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/virt/libvirt_conn.py'
2--- nova/virt/libvirt_conn.py 2011-03-16 09:38:48 +0000
3+++ nova/virt/libvirt_conn.py 2011-03-16 18:54:00 +0000
4@@ -984,18 +984,19 @@
5
6 xml = self._conn.getCapabilities()
7 xml = libxml2.parseDoc(xml)
8- nodes = xml.xpathEval('//cpu')
9+ nodes = xml.xpathEval('//host/cpu')
10 if len(nodes) != 1:
11 raise exception.Invalid(_("Invalid xml. '<cpu>' must be 1,"
12 "but %d\n") % len(nodes)
13 + xml.serialize())
14
15 cpu_info = dict()
16- cpu_info['arch'] = xml.xpathEval('//cpu/arch')[0].getContent()
17- cpu_info['model'] = xml.xpathEval('//cpu/model')[0].getContent()
18- cpu_info['vendor'] = xml.xpathEval('//cpu/vendor')[0].getContent()
19+ cpu_info['arch'] = xml.xpathEval('//host/cpu/arch')[0].getContent()
20+ cpu_info['model'] = xml.xpathEval('//host/cpu/model')[0].getContent()
21+ cpu_info['vendor'] = xml.xpathEval('//host/cpu/vendor')[0].getContent()
22
23- topology_node = xml.xpathEval('//cpu/topology')[0].get_properties()
24+ topology_node = xml.xpathEval('//host/cpu/topology')[0]\
25+ .get_properties()
26 topology = dict()
27 while topology_node != None:
28 name = topology_node.get_name()
29@@ -1009,7 +1010,7 @@
30 raise exception.Invalid(_("Invalid xml: topology(%(topology)s) "
31 "must have %(ks)s") % locals())
32
33- feature_nodes = xml.xpathEval('//cpu/feature')
34+ feature_nodes = xml.xpathEval('//host/cpu/feature')
35 features = list()
36 for nodes in feature_nodes:
37 features.append(nodes.get_properties().getContent())