Bug 1422901 - Unable to use the same tenant name across multiple regions.
Summary: Unable to use the same tenant name across multiple regions.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.7.0
Hardware: All
OS: All
unspecified
medium
Target Milestone: GA
: 5.10.0
Assignee: Gregg Tanzillo
QA Contact: Pavol Kotvan
URL:
Whiteboard: distributed:cfme_tenant
Depends On:
Blocks: 1517954
TreeView+ depends on / blocked
 
Reported: 2017-02-16 14:10 UTC by Josh Carter
Modified: 2021-06-10 11:56 UTC (History)
9 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1517954 (view as bug list)
Environment:
Last Closed: 2018-06-21 20:55:28 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2939501 0 None None None 2017-02-22 00:46:16 UTC

Description Josh Carter 2017-02-16 14:10:03 UTC
Description of problem:

Problem Description
#######################
- CFME 4.2
- Trying to rename the tenant in our global CloudForms region from "My Company" to "Kaiser Permanente"
- When trying to use "Kaiser Permanente" in Tenant name, CFME is returning this error msg:
 "Error when adding a new tenant: Validation failed: Name should be unique per parent"
- But when trying to use "Kaiser Permanente Global", it works. 
- Assuming that the uniqueness check for the name doesn't filter by region, and sees that the tenant name returning error in the global region is already used by a local region.

Action Taken
#######################
Collected tenant info from SQL query(select * from tenants;)
=> Confirmed that there are 3 local regional tenants with "Kaiser Permanente" and 1 global tenant with "Kaiser Permanente Global" which originated from "My Company"
Checked collected logs from 3 UI nodes, found related err and change.

<UI node 14>
E, [2017-02-15T14:49:58.325164 #2478:16ece80] ERROR -- : MIQ(ops_controller-rbac_tenant_edit): Error when adding a new tenant: Validation failed: Name should be unique per parent

<UI node 15>
E, [2017-02-15T14:54:53.275167 #25438:ccc478] ERROR -- : MIQ(ops_controller-rbac_tenant_edit): Error when adding a new tenant: Validation failed: Name should be unique per parent

I, [2017-02-15T15:04:42.603757 #30991:d3e76c]  INFO -- Success: MIQ(OpsRbac.rbac_tenant_edit) userid: [admin] - [Kaiser Permanente Global] Record updated (name changed to Kaiser Permanente Global, description changed to Kaiser Permanente Global, region_number changed to , region_description changed to , allocated_memory changed to , allocated_vcpu changed to , allocated_storage changed to , provisioned_storage changed to , parent_name changed to , display_type changed to )

Request to Collaborator

Version-Release number of selected component (if applicable): 5.7.0.


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 4 Gregg Tanzillo 2017-11-20 21:02:00 UTC
Yoder, I just created a PR for this - https://github.com/ManageIQ/manageiq/pull/16506

Comment 5 CFME Bot 2017-11-27 16:12:05 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/f2d4533a79ce05c3ef751ec66c710a4b231910ee

commit f2d4533a79ce05c3ef751ec66c710a4b231910ee
Author:     Gregg Tanzillo <gtanzill>
AuthorDate: Mon Nov 20 15:58:25 2017 -0500
Commit:     Gregg Tanzillo <gtanzill>
CommitDate: Mon Nov 20 16:03:51 2017 -0500

    Scope Tenant#name validation to the current region
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1422901

 app/models/tenant.rb       | 4 +++-
 spec/models/tenant_spec.rb | 9 +++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)


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