Comment 2 for bug 2012928

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

Reviewed: https://review.opendev.org/c/openstack/oslo.db/+/878642
Committed: https://opendev.org/openstack/oslo.db/commit/da4f13e7345653eba8aab5b8aceeaeff7367989e
Submitter: "Zuul (22348)"
Branch: master

commit da4f13e7345653eba8aab5b8aceeaeff7367989e
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Mon Mar 27 15:12:06 2023 +0200

    Do not convert to string ``url.URL`` objects

    The SQLAlchemy method ``url.make_url`` accepts strings and ``url.URL``
    object types. By default, oslo.db was converting any object to string
    before calling ``url.make_url``, that parses this string. Since
    SQLAlchemy 2.0, the ``url.URL.__str__`` method is removed and the
    ``url.URL.__repr__`` method returns a string with the password hidden.

    The new utility method checks what type of object is passed and only
    if the object is not a string nor a ``url.URL`` object, is converted
    to a string.

    Closes-Bug: #2012928
    Change-Id: I84f13f378f83e2a55078370ae2b4787f00982c23