Comment 5 for bug 1314732

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to ironic (master)

Reviewed: https://review.openstack.org/108959
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=e2e89126efa1ed910f269e2798e7b8b63adaf841
Submitter: Jenkins
Branch: master

commit e2e89126efa1ed910f269e2798e7b8b63adaf841
Author: Lucas Alvares Gomes <email address hidden>
Date: Wed Jul 23 12:14:21 2014 +0100

    Clean up calls to get_chassis()

    The same work have already been done by Nodes (see 2192f2848e), so right
    now the dbapi's are inconsistent across different objects. This patch
    fixes it for Chassis.

    This patch removes all direct calls to dbapi's get_chassis(). They
    are replaced either by Chassis.get(), Chassis.get_by_id(), or
    Chassis.get_by_uuid() calls.

    Additional detail about the changes:

    1) Break DBAPI get_chassis() into get_chassis_by_id() and get_chassis_by_uuid().
    Let's be explicit about which type we're passing. This allows
    Chassis.get_by_uuid() to work exactly how its named. Also, do not
    return an object from the DB API calls. The Chassis object itself will
    do the conversion.

    2) Adds Chassis.get_by_id() to compliment the current
    Chassis.get_by_uuid() for places you are querying by the ID.

    3) Adds Chassis.get() so that you can still have a single method to use
    to pass either and ID or a UUID.

    4) Make all of the Chassis.get* calls set the 'context' so that you
    can later just chassis.save() without passing it. Doc strings have been
    updated to clarify what 'context' is for.

    Co-Authored-By: Chris Behrens <email address hidden>
    Related-Bug: #1314732
    Change-Id: I5162c2843e15e538c1dc50dd5ac775298f8f0f9d