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.
https://github.com/ManageIQ/manageiq/pull/8240
For the record, this is related to bug 1265221.
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(-)
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.