[env-templates] Public/private filters for environment templates doesn't work correctly

Bug #1540709 reported by Victor Ryzhenkin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Murano
Fix Released
Medium
Lin Yang

Bug Description

1. Create Public and Private templates in primary tenant
2. Create Private template in alt tenant
3. Make request to /v1/templates?is_public=true
4. Make sure, that all ok
5. Make request to /v1/templates?is_public=false using primary tenant

Expected: Only private templates returned

Actual: All templates, belongs to tenant is listed

Example:

{u'updated': u'2016-02-02T02:21:53', u'name': u'get_public_private_both_40107109', u'created': u'2016-02-02T02:21:53', u'tenant_id': u'd34f664a6a1c471da73cd56e957ba065', u'version': 0, u'is_public': True, u'id': u'bf38ddb166cb42f0972f47fe38d48de4'}, {u'updated': u'2016-02-02T02:21:53', u'name': u'get_public_private_both_9eb42eba', u'created': u'2016-02-02T02:21:53', u'tenant_id': u'd34f664a6a1c471da73cd56e957ba065', u'version': 0, u'is_public': False, u'id': u'b18128f589e94117954cab616c619ad1'}, {u'updated': u'2016-02-02T02:21:50', u'name': u'TestEnvironmentTemplates_5e0b4fb6', u'created': u'2016-02-02T02:21:50', u'tenant_id': u'd34f664a6a1c471da73cd56e957ba065', u'version': 0, u'is_public': True, u'id': u'3e1c9837cdee452bb13045ebbd3db3c0'}

Lin Yang (lin-a-yang)
Changed in murano:
assignee: nobody → Lin Yang (lin-a-yang)
Revision history for this message
Victor Ryzhenkin (vryzhenkin) wrote :

Hey, Lin! It's very cool, that you assigned bug to yourself! Thank you!
Some fruitful information about it:
 Code. that you need, located here: https://github.com/openstack/murano/blob/master/murano/api/v1/templates.py#L52

Revision history for this message
Lin Yang (lin-a-yang) wrote :

Hi Victor, thanks a lot for this information.

I assigned this to myself when found it's unassigned. Do you already working on this? If not, I will try to fix it.

Revision history for this message
Victor Ryzhenkin (vryzhenkin) wrote :

Lin, please, do! :)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to murano (master)

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

Changed in murano:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on murano (master)

Change abandoned by Lin Yang (<email address hidden>) on branch: master
Review: https://review.openstack.org/276782
Reason: Combined this patch with https://review.openstack.org/#/c/277079/. Abandoned this.

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

Reviewed: https://review.openstack.org/277079
Committed: https://git.openstack.org/cgit/openstack/murano/commit/?id=72cc7bf68edc900df50c06549e1206ef715e0cd0
Submitter: Jenkins
Branch: master

commit 72cc7bf68edc900df50c06549e1206ef715e0cd0
Author: Lin Yang <email address hidden>
Date: Sat Feb 6 21:14:30 2016 +0800

    Fix incorrect result of listing templates

    - When user executes 'murano env-template-list', it only returns all
      templates belong this tenant, and doesn't include public templates
      from other tenants.
    - It returns all templates belong to tenant when only requests
      private templates.

    Change-Id: I50f70f28827c851139f74cff3923843c3d48170b
    Closes-Bug: #1542626
    Closes-Bug: #1540709

Changed in murano:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/murano 2.0.0.0b3

This issue was fixed in the openstack/murano 2.0.0.0b3 development milestone.

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.