inconsistent ID types from projects in dbapi

Bug #1661670 reported by Thomas Maddox
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
craton
Fix Released
Undecided
Thomas Maddox

Bug Description

Essentially, we're getting str typed IDs on the Project object we get back from dbapi.projects_create and UUID typed IDs on the Project object we get back from dbapi.projects_get*. We want these all to return UUID typed IDs.

Acceptance Criteria:
1. dbapi surface for Projects returns Project objects that use a UUID typed ID for the ID attribute.

IRC snippet:

10:00 thomasem: Hmmm... I think we might be getting back inconsistent data types for project ID from the db api.
10:00 thomasem: sometimes it's UUID type, other times it's str
10:01 sigmavirus: thomasem: oh?
10:01 sigmavirus: It should always be UUID type
10:01 thomasem: Okay, lemme confirm. Could be something I did wrong.
10:01 thomasem: Thanks for the clarification.
10:03 VW has joined (~vw@108.166.30.184)
10:05 thomasem: TEM create: <class 'str'>
10:05 thomasem: TEM by_id: <class 'uuid.UUID'>
10:05 thomasem: Yeah, on create it returns a Project object with an str ID attribute, and on get it returns a Project with a UUID type id.
10:06 jimbaker: right, we like to keep it in the abstract type to the extent possible
10:06 thomasem: sigmavirus: ^^
10:06 jimbaker: same with ip addresses, etc
10:06 jimbaker: or ints for that matter :)
10:06 thomasem: So.. you're saying that we want that behavior?
10:06 thomasem: Even though it's inconsistent Project objects from the dbapi
10:06 jimbaker: thomasem, we want consistent behavior
10:06 thomasem: Okay, so then this is a bug. :)
10:06 jimbaker: and we want to keep it in the closest possible type
10:07 jimbaker: so that gives you the acceptance criteria :)
10:07 jimbaker: fortunately, we are not writing this code in tcl
10:07 thomasem: Cool. Thanks. I'll write up the bug and work around it in the tests with notes.

Changed in craton:
assignee: nobody → Thomas Maddox (thomas-maddox)
summary: - inconsistent-id-types-from-projects-in-dbapi
+ inconsistent ID types from projects in dbapi
Changed in craton:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to craton (master)

Reviewed: https://review.openstack.org/427777
Committed: https://git.openstack.org/cgit/openstack/craton/commit/?id=603cef7a31f89ee73259ed7ceeb859cc7eef7811
Submitter: Jenkins
Branch: master

commit 603cef7a31f89ee73259ed7ceeb859cc7eef7811
Author: Ian Cordasco <email address hidden>
Date: Wed Feb 15 08:41:49 2017 -0600

    Adds Variables support to Projects resource

    Includes Variables support, which is already present
    in several other Craton resources, in the Projects
    resource as well.

    Project variables will serve as a top-most scope
    of variables for resources that belong to a specific
    project.

    Partial-Bug: 1648626
    Closes-Bug: 1661670

    Change-Id: I574e834ce409efd8ceafb15fe30a86ae93df2a80

Changed in craton:
status: In Progress → Fix Released
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.