ServerExternalEventsController doesn't properly pre-load migration_context

Bug #1645479 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Matt Riedemann
Newton
Fix Committed
Low
Matt Riedemann

Bug Description

This code is passing a string for expected_attrs when getting all instances:

https://github.com/openstack/nova/blob/4e747092bcb015303efc2ab13da98ef5ce575ec8/nova/api/openstack/compute/server_external_events.py#L72

That's used to join the migration_context from the DB, but it's not doing that as expected_attr should be a list:

https://github.com/openstack/nova/blob/4e747092bcb015303efc2ab13da98ef5ce575ec8/nova/objects/instance.py#L73

So we aren't getting the optimization in the API.

That was added in https://review.openstack.org/#/c/371048/ which was also backported to stable/newton.

Tags: api
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/403917

Changed in nova:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/403917
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=cbcff11b6a206a58093017fb9471d818d484ca34
Submitter: Jenkins
Branch: master

commit cbcff11b6a206a58093017fb9471d818d484ca34
Author: Matt Riedemann <email address hidden>
Date: Mon Nov 28 16:45:58 2016 -0500

    Fix expected_attrs kwarg in server_external_events

    The Instance.get_by_uuid method takes an expected_attrs
    kwarg which needs to be a list or tuple, not just any old
    iterable like a string. Because of how the underlying
    Instance object code massages this value, it's not a hard
    failure but does mean you don't join the columns you expect
    when getting the instance.

    This makes it a list and makes sure the stub in the unit
    tests is checking for valid values.

    Change-Id: I3ad85f9062b5cb19962d9e6a7af52440166def45
    Closes-Bug: #1645479

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/404496

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

Reviewed: https://review.openstack.org/404496
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=c3f0f2ebc1b8b3b8c6bf8a596df62063519a0844
Submitter: Jenkins
Branch: stable/newton

commit c3f0f2ebc1b8b3b8c6bf8a596df62063519a0844
Author: Matt Riedemann <email address hidden>
Date: Mon Nov 28 16:45:58 2016 -0500

    Fix expected_attrs kwarg in server_external_events

    The Instance.get_by_uuid method takes an expected_attrs
    kwarg which needs to be a list or tuple, not just any old
    iterable like a string. Because of how the underlying
    Instance object code massages this value, it's not a hard
    failure but does mean you don't join the columns you expect
    when getting the instance.

    This makes it a list and makes sure the stub in the unit
    tests is checking for valid values.

    Change-Id: I3ad85f9062b5cb19962d9e6a7af52440166def45
    Closes-Bug: #1645479
    (cherry picked from commit cbcff11b6a206a58093017fb9471d818d484ca34)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 15.0.0.0b2

This issue was fixed in the openstack/nova 15.0.0.0b2 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 14.0.3

This issue was fixed in the openstack/nova 14.0.3 release.

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.