nova-manage floating list command failed

Bug #1032177 reported by Ray
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Ray

Bug Description

I use devstack to install the latest nova code and then I create some vms and terminate them. After these operations, I found I can't use nova-manage floating list to see the status of the floating list, it shows me:

ray@openstack-dev:/opt/stack/nova/bin$ nova-manage floating list
2012-08-02 18:04:26 DEBUG nova.utils [req-362967cf-52f3-4795-ab52-248cf8fbfec2 None None] backend <module 'nova.db.sqlalchemy.api' from '/opt/stack/nova/nova/db/sqlalchemy/api.pyc'> from (pid=21863) __get_backend /opt/stack/nova/nova/utils.py:487
Command failed, please check log for more info

Then I tried to print out the Exception in main() in nova-manage, I got:
ray@openstack-dev:/opt/stack/nova/bin$ nova-manage floating list
2012-08-02 18:05:52 DEBUG nova.utils [req-6212831f-7024-4778-aa1a-6ecc29b68017 None None] backend <module 'nova.db.sqlalchemy.api' from '/opt/stack/nova/nova/db/sqlalchemy/api.pyc'> from (pid=21937) __get_backend /opt/stack/nova/nova/utils.py:487
local variable 'instance_uuid' referenced before assignment
Command failed, please check log for more info

After I modified the instance_uuid = None on line 414, seems everything goes well.
 413 for floating_ip in floating_ips:
 414 instance_id = None
 415 if floating_ip['fixed_ip_id']:
 416 fixed_ip = db.fixed_ip_get(ctxt, floating_ip['fixed_ip_id '])
 417 instance_uuid = fixed_ip['instance_uuid']
 418
 419 print "%s\t%s\t%s\t%s\t%s" % (floating_ip['project_id'],
 420 floating_ip['address'],
 421 instance_uuid,
 422 floating_ip['pool'],
 423 floating_ip['interface'])

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/10712

Changed in nova:
assignee: nobody → xiaoquqi (xiaoquqi)
status: New → In Progress
Revision history for this message
Ray (xiaoquqi) wrote :

I submit the fix here:
https://review.openstack.org/10712

Please give me some suggestions. Thanks.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/10712
Committed: http://github.com/openstack/nova/commit/143b4671cce2a0996018509f6ce38c0902acde09
Submitter: Jenkins
Branch: master

commit 143b4671cce2a0996018509f6ce38c0902acde09
Author: Ray Sun <email address hidden>
Date: Thu Aug 2 21:13:33 2012 +0800

    Fix regression with nova-manage floating list

    Fixes bug #1032177

    If a floating IP is not associated with an instance, nova-manage fails
    with:

      local variable 'instance_uuid' referenced before assignment

    This is a regression introduced by commit fc82c6d. Simply rename
    the local variable to instance_uuid.

    Change-Id: Ia6df23c945f0815c65bcfd2f49e8ba3225d03d7f

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-3 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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