Bug 1328265 - parent tenant name changes are not reflected via the api
Summary: parent tenant name changes are not reflected via the api
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.5.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: GA
: 5.7.0
Assignee: Šimon Lukašík
QA Contact: Martin Kourim
URL:
Whiteboard: rest:tenant
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-18 20:29 UTC by Colin Arnott
Modified: 2017-01-12 05:00 UTC (History)
7 users (show)

Fixed In Version: 5.7.0.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1340072 (view as bug list)
Environment:
Last Closed: 2017-01-11 19:51:34 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
webUI for cfme tenants (119.62 KB, image/png)
2016-04-18 20:29 UTC, Colin Arnott
no flags Details

Description Colin Arnott 2016-04-18 20:29:13 UTC
Created attachment 1148279 [details]
webUI for cfme tenants

Description of problem:
when you change the main parent tenant's name that change is not reflected in api calls

Version-Release number of selected component (if applicable):
cfme-5.5.3.4-1.el7cf.x86_64

How reproducible:
very

Steps to Reproduce:
0. rename the default parent tenant
1. $ curl https://example.com/api/tenants/1000000000001

Actual results:
{"href":"https://example.com/api/tenants/1000000000001","id":1000000000001,"name":"My Company","divisible":true,"description":"Tenant for My Company","use_config_for_attributes":true,"default_miq_group_id":1000000000001,"actions":[{"name":"edit","method":"post","href":"https://example.com/api/tenants/1000000000001"},{"name":"delete","method":"post","href":"https://example.com/api/tenants/1000000000001"},{"name":"delete","method":"delete","href":"https://example.com/api/tenants/1000000000001"}]}

Expected results:
{"href":"https://example.com/api/tenants/1000000000001","id":1000000000001,"name":"Red Hat Support","divisible":true,"description":"Tenant for My Company","use_config_for_attributes":true,"default_miq_group_id":1000000000001,"actions":[{"name":"edit","method":"post","href":"https://example.com/api/tenants/1000000000001"},{"name":"delete","method":"post","href":"https://example.com/api/tenants/1000000000001"},{"name":"delete","method":"delete","href":"https://example.com/api/tenants/1000000000001"}]}

Additional info:
the attached screenshot displays the information that can be seen through the webUI

it is assumed that this is due to the inability to rename a tenant after creation, however this could be inaccurate.

Comment 3 Šimon Lukašík 2016-04-26 14:30:45 UTC
For the record, this is related to bug 1265221.

Comment 4 CFME Bot 2016-05-23 23:00:57 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/4a92b0f458bc0f8ef04e44fdce716547bf3e6025

commit 4a92b0f458bc0f8ef04e44fdce716547bf3e6025
Author:     Šimon Lukašík <isimluk>
AuthorDate: Tue Apr 26 12:29:27 2016 +0200
Commit:     Šimon Lukašík <isimluk>
CommitDate: Tue Apr 26 12:29:27 2016 +0200

    Respect local overrides when serializing ActiveRecord to json
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1328265
    
    Some models override default accessors like Tenant#name does. When
    serializing these models to json, we should respect the overrides. That
    way we ensure that webui and api present consistent data.

 app/controllers/api_controller/normalizer.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 6 Martin Kourim 2016-10-06 17:06:26 UTC
Verified by changing main parent tenant's name in user Configuration -> Access Control -> Tenants -> My Company, selected Configuration -> "Edit this item", set "Use Configuration Settings" to No, changed Name, saved, and verified using "GET /api/tenants/1" request that the change was reflected via the api.


Note You need to log in before you can comment on or make changes to this bug.