Climate V2 API returns tenant_id with dashes

Bug #1306622 reported by Pablo Andres Fuente
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Blazar
Fix Released
Low
Pablo Andres Fuente

Bug Description

For example, if you query the V2 API to get all the leases, the tenant_id fields are rendered with slashes. This isn't wrong, but if a user copy and paste this in order to perform queries by tenant (will be implemented on https://bugs.launchpad.net/climate/+bug/1304435), the query files because the tenant_id are stored in the DB without slashes.

Example of GET /leases

[
  {
    "user_id": "aac3f366-278e-4de0-bda3-d362c44b1a2d",
    "name": "admin-lease",
    "end_date": "2014-10-25T12:08:00.000000",
    "reservations": [
      {
        "status": "pending",
        "lease_id": "c3123f7b-a6a2-4c55-ad20-ad3e0aae0b59",
        "resource_id": "7cead9f7-059e-4436-9259-b98d20e5a3ee",
        "created_at": "2014-04-11 13:47:34.849512",
        "updated_at": null,
        "id": "2401fbff-cd21-4d7b-b3bb-2b36e29f1d10",
        "resource_type": "virtual:instance"
      }
    ],
    "created_at": "2014-04-11 13:47:34.819719",
    "updated_at": null,
    "id": "c3123f7b-a6a2-4c55-ad20-ad3e0aae0b59",
    "start_date": "2014-06-25T12:05:00.000000",
    "tenant_id": "01bf2a0b-ae3c-4f7a-9ff8-a8ec5c3fc94a",
    "events": [
      {
        "status": "UNDONE",
        "lease_id": "c3123f7b-a6a2-4c55-ad20-ad3e0aae0b59",
        "event_type": "end_lease",
        "created_at": "2014-04-11 13:47:34.828832",
        "updated_at": null,
        "time": "2014-10-25T12:08:00.000000",
        "id": "106183ab-c825-4124-91cf-74a7e873efd5"
      },
      {
        "status": "UNDONE",
        "lease_id": "c3123f7b-a6a2-4c55-ad20-ad3e0aae0b59",
        "event_type": "start_lease",
        "created_at": "2014-04-11 13:47:34.825399",
        "updated_at": null,
        "time": "2014-06-25T12:05:00.000000",
        "id": "25b3e45c-08c8-4750-98b2-99c3a78b7987"
      }
    ],
    "trust_id": "d593d51c-2b3e-451b-8e5d-7d69ebfe7f8b"
  },
  {
    "user_id": "f60582fb-e191-46ba-9d09-c01f6393f73f",
    "name": "demo-lease",
    "end_date": "2014-10-25T12:08:00.000000",
    "reservations": [
      {
        "status": "pending",
        "lease_id": "b5e92cc1-28e7-4182-8e19-7fdafb53e3d7",
        "resource_id": "a58aa0be-4cfb-4c31-b518-6bf0c7f2de83",
        "created_at": "2014-04-11 13:48:50.863503",
        "updated_at": null,
        "id": "92497cef-a943-4ea5-94a2-cdd25ad717a6",
        "resource_type": "virtual:instance"
      }
    ],
    "created_at": "2014-04-11 13:48:50.836820",
    "updated_at": null,
    "id": "b5e92cc1-28e7-4182-8e19-7fdafb53e3d7",
    "start_date": "2014-06-25T12:05:00.000000",
    "tenant_id": "1e38ecbf-e9bd-4ead-b03e-51bb6ce76ca1",
    "events": [
      {
        "status": "UNDONE",
        "lease_id": "b5e92cc1-28e7-4182-8e19-7fdafb53e3d7",
        "event_type": "end_lease",
        "created_at": "2014-04-11 13:48:50.841066",
        "updated_at": null,
        "time": "2014-10-25T12:08:00.000000",
        "id": "3bad7365-c2ed-48ef-b65b-677c45d59d22"
      },
      {
        "status": "UNDONE",
        "lease_id": "b5e92cc1-28e7-4182-8e19-7fdafb53e3d7",
        "event_type": "start_lease",
        "created_at": "2014-04-11 13:48:50.839275",
        "updated_at": null,
        "time": "2014-06-25T12:05:00.000000",
        "id": "1f2cb71c-8c31-4886-af2d-ec2b2e4da646"
      }
    ],
    "trust_id": "41635286-9c9c-4e3e-bc5e-87395b389b3e"
  }
]

Dina Belova (dbelova)
summary: - Climate V2 API returns tenant_id with slashes
+ Climate V2 API returns tenant_id with dashes
Changed in climate:
importance: Undecided → Low
status: New → Confirmed
Changed in climate:
assignee: nobody → Pablo Andres Fuente (pablo-a-fuente)
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix proposed to climate (master)

Fix proposed to branch: master
Review: https://review.openstack.org/89412

Changed in climate:
status: Confirmed → In Progress
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to climate (master)

Reviewed: https://review.openstack.org/89412
Committed: https://git.openstack.org/cgit/stackforge/climate/commit/?id=9aeedec8562a37de8eee6140181589c9fdf639ec
Submitter: Jenkins
Branch: master

commit 9aeedec8562a37de8eee6140181589c9fdf639ec
Author: Pablo Andres Fuente <email address hidden>
Date: Mon Apr 21 17:10:29 2014 -0300

    API returns project/user/trust ids without dashes

    Added a new parameter to the UuidType used by the V2 API. The idea of
    this parameter is to configure if the UUID will be returned
    with or without dashes.

    Change-Id: I7bbc213ed8effa568df2ab0a83b579bfb7c79a23
    Closes-Bug: #1306622

Changed in climate:
status: In Progress → Fix Committed
Changed in blazar:
milestone: none → 0.1.1
Changed in blazar:
status: Fix Committed → 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.