Comment 6 for bug 1818047

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

Reviewed: https://review.openstack.org/642611
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=cfad7a1faae9aec6041c49149ad923c407f30219
Submitter: Zuul
Branch: stable/rocky

commit cfad7a1faae9aec6041c49149ad923c407f30219
Author: Matt Riedemann <email address hidden>
Date: Tue Mar 5 09:00:20 2019 -0500

    Handle templated cell mappings in nova-status

    The nova-status upgrade check code is intentionally written
    to not use versioned objects and just work with the data model
    directly.

    However, CellMapping database_connection template support was
    added in Rocky and the template URL is only formatted when using
    the object on read from the database, which means if you are using
    a template for the database_connection nova-status will break since
    the get_engine() code is getting a template string rather than a
    properly formatted URL.

    This change fixes the bug by using the CellMapping object code to
    pull the mappings from the database which will format the database
    connection URL. Note that we cannot simply update the sqlalchemy
    RowProxy objects we get normally since those are read-only, and
    because of how the mappings are used as objects with attribute
    access rather than as a dict we cannot just convert the RowProxy
    to a dict - we would have to put it in some kind of object for
    attribute access and if we are going to do that we might as well
    just use the CellMapping objects we have so that's what we do in
    this change.

    Change-Id: I5ce175517f6feb6e82ba507078a565b71427a4b0
    Closes-Bug: #1818047
    (cherry picked from commit 38f2ce549ce4b21d5085824df701f9d2392b5604)