when using templated cells urls, validation fails with create_cell when using {scheme} and {port}

Bug #1812196 reported by Martin Schuppert
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Dan Smith
Rocky
Fix Committed
Medium
Matt Riedemann

Bug Description

When using templated cells urls as in https://docs.openstack.org/nova/rocky/user/cells.html#template-urls-in-cell-mappings , there is an issue with nova-manage parsing the transport url when we use {scheme} or {port}. The validation in nova-manage fails with:

* {scheme} - No scheme specified:

()[root@undercloud /]# su nova -s /bin/bash -c "/usr/bin/nova-manage cell_v2 create_cell --name=default --database_connection='{scheme}://{username}:{password}@{hostname}/nova?{query}' --transport-url='{scheme}://{username}:{password}@{hostname}:{port}/?{query}' --verbose"
Invalid transport URL: No scheme specified

* {port} - expects an int for the port:

()[root@undercloud /]# su nova -s /bin/bash -c "/usr/bin/nova-manage cell_v2 create_cell --name=default --database_connection='{scheme}://{username}:{password}@{hostname}/nova?{query}' --transport-url='rabbit://{username}:{password}@{hostname}:{port}/?{query}' --verbose"
Invalid transport URL: invalid literal for int() with base 10: '{port}'

Tags: cells
Matt Riedemann (mriedem)
tags: added: cells
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/631649

Changed in nova:
assignee: nobody → Dan Smith (danms)
status: New → In Progress
Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → Medium
importance: Medium → Critical
importance: Critical → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/633086

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

Reviewed: https://review.openstack.org/631649
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=edd1cd9ee4d149b01a388f03fb423374020033d7
Submitter: Zuul
Branch: master

commit edd1cd9ee4d149b01a388f03fb423374020033d7
Author: Dan Smith <email address hidden>
Date: Thu Jan 17 13:27:25 2019 -0800

    Fix using template cell urls with nova-manage

    When nova-manage went to validate the transport-url given in config or on the
    command line, it was not doing the translation before passing the url to the
    oslo.messaging parse routine to check it. This exposes the format functions
    from the CellMapping object, and makes our _validate_transport_url() format
    the url before passing it to parse.

    This also adds a test that makes sure the template makes it into the database
    (as a template) and that it gets loaded out in translated form with an
    object load.

    Change-Id: I40a435b8e97c8552c2f5f0ca3a24de2edd9f81bd
    Closes-Bug: #1812196

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

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

commit a0f5618ffa02cc8622669a5c31b98f9b4773ed60
Author: Dan Smith <email address hidden>
Date: Thu Jan 17 13:27:25 2019 -0800

    Fix using template cell urls with nova-manage

    When nova-manage went to validate the transport-url given in config or on the
    command line, it was not doing the translation before passing the url to the
    oslo.messaging parse routine to check it. This exposes the format functions
    from the CellMapping object, and makes our _validate_transport_url() format
    the url before passing it to parse.

    This also adds a test that makes sure the template makes it into the database
    (as a template) and that it gets loaded out in translated form with an
    object load.

    Change-Id: I40a435b8e97c8552c2f5f0ca3a24de2edd9f81bd
    Closes-Bug: #1812196
    (cherry picked from commit edd1cd9ee4d149b01a388f03fb423374020033d7)

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

This issue was fixed in the openstack/nova 19.0.0.0rc1 release candidate.

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

This issue was fixed in the openstack/nova 18.2.0 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.