test_libvirt missing uuid field in instance

Bug #931794 reported by Ken Thomas
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Michael Still

Bug Description

I ran into this in RHEL 6.2 with nova/run_tests.sh in the non-virtual environment. Test "test_destroy_saved" in test_libvirt.py fails because its instance is missing a 'uuid' field. The instance eventually gets logged, but since it doesn't have a 'uuid' field, the test dies in the logger.

Adding a 'uuid' field with a value of zero (around line 1157) gets the test to complete.

Here's the trace.

./run_tests.sh -N

======================================================================
ERROR: test_destroy_saved (nova.tests.test_libvirt.LibvirtConnTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/kens/nova/app/nova/test.py", line 87, in _skipper
    func(*args, **kw)
  File "/tmp/kens/nova/app/nova/tests/test_libvirt.py", line 1158, in test_destroy_saved
    conn.destroy(instance, [])
  File "/tmp/kens/nova/app/nova/virt/libvirt/connection.py", line 422, in destroy
    cleanup=True)
  File "/tmp/kens/nova/app/nova/virt/libvirt/connection.py", line 404, in _destroy
    network_info=network_info)
  File "/tmp/kens/nova/app/nova/virt/libvirt/firewall.py", line 493, in unfilter_instance
    'filtered'), instance=instance)
  File "/tmp/kens/nova/app/nova/log.py", line 203, in info
    self._update_extra(kwargs)
  File "/tmp/kens/nova/app/nova/log.py", line 181, in _update_extra
    % params['instance'])})
KeyError: 'uuid'

Ken Thomas (krt)
Changed in nova:
assignee: nobody → Ken Thomas (krt)
Revision history for this message
Michael Still (mikal) wrote :

Ken -- I introduced this bug, and I'm happy to fix it if you're not actively working on it already. It should just be a case of adding a uuid to the fake instance in whatever unit test this is. It should have that anyways, because uuids are used all over the place now.

summary: - test_libvirt missing uuid field in instace
+ test_libvirt missing uuid field in instance
Revision history for this message
Michael Still (mikal) wrote :

Actually, I thought about this some more and because this is a failure of a unit test on master I've stolen the bug and sent off a review with the fix. Sorry to stomp on you... The review is https://review.openstack.org/#change,4130 .

Changed in nova:
assignee: Ken Thomas (krt) → Michael Still (mikalstill)
status: New → In Progress
Revision history for this message
Ken Thomas (krt) wrote :

No problem, I had a fix ready to go (with a fake uuid as you described) but I'm having issues getting signed up to submit it for review. I'm glad that a fix got in without me holding things up. Thanks!

Brian Waldon (bcwaldon)
Changed in nova:
milestone: none → essex-4
Michael Still (mikal)
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-4 → 2012.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.