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
Reviewed: https:/ /review. openstack. org/108959 /git.openstack. org/cgit/ openstack/ ironic/ commit/ ?id=e2e89126efa 1ed910f269e2798 e7b8b63adaf841
Committed: https:/
Submitter: Jenkins
Branch: master
commit e2e89126efa1ed9 10f269e2798e7b8 b63adaf841
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 get_by_ id(), or get_by_ uuid() calls.
are replaced either by Chassis.get(), Chassis.
Chassis.
Additional detail about the changes:
1) Break DBAPI get_chassis() into get_chassis_by_id() and get_chassis_ by_uuid( ). get_by_ uuid() to work exactly how its named. Also, do not
Let's be explicit about which type we're passing. This allows
Chassis.
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 get_by_ uuid() for places you are querying by the ID.
Chassis.
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> 38c1dc50dd5ac77 5298f8f0f9d
Related-Bug: #1314732
Change-Id: I5162c2843e15e5