Bug 1276405

Summary: UI should not allow duplicate providers to be added
Product: Red Hat CloudForms Management Engine Reporter: Pavol Kotvan <pakotvan>
Component: ProvidersAssignee: Lucy Fu <lufu>
Status: CLOSED ERRATA QA Contact: Pavol Kotvan <pakotvan>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.5.0CC: bascar, hkataria, jfrey, jhardy, mpovolny, obarenbo, simaishi
Target Milestone: GA   
Target Release: 5.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.5.0.12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-08 13:42:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Screenshot - warning that provider has been added already none

Description Pavol Kotvan 2015-10-29 15:49:30 UTC
Description of problem:
With multiple tenants configured, each tenant has ability to add the same provider. Super admin then can see the same provider multiple times. Number of hosts per provider is changing over time in the providers' quadicons.
Please see BZ#1273392 for more details and screenshots. 

Version-Release number of selected component (if applicable):
5.5.0.5-beta1.1.20151007163855_ed40d96

How reproducible:
always


Steps to Reproduce:
Please check BZ#1273392 for steps how to reproduce it.

Actual results:


Expected results:
UI should not allow duplicate providers to be added.

Additional info:

Comment 2 Greg McCullough 2015-11-17 18:10:12 UTC
Brad - Currently the provider validation limits scope to the current tenant.  Since we do not support adding the same provider twice in any condition we can expand the validation to check any provider.  The caveat being that the second tenant to add the provider will not be able to see that the provider already exists in another tenant before trying to add and getting an error.  In my opinion this is still better than allowing the provider to be added twice which causes many other issues.

Comment 3 bascar 2015-11-17 21:09:42 UTC
Yes, please prevent adding another of the same provider. It is fine to throw an error to the person adding the provider that it is already added elsewhere in the system and to sync up with an admin to help rectify.

Comment 4 Greg McCullough 2015-11-17 21:32:26 UTC
Lucy - Please update the EMS validation for hostname so that uniqueness is not scoped to the tenant.

Comment 6 CFME Bot 2015-11-18 19:00:20 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/83e2f17f9221196b27efae3148ce801bdfb3385b

commit 83e2f17f9221196b27efae3148ce801bdfb3385b
Author:     Lucy Fu <lufu>
AuthorDate: Wed Nov 18 12:16:57 2015 -0500
Commit:     Lucy Fu <lufu>
CommitDate: Wed Nov 18 12:18:34 2015 -0500

    Update the EMS validation for hostname so that uniqueness is not scoped to the tenant.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1276405

 app/models/ext_management_system.rb       | 2 +-
 spec/models/ext_management_system_spec.rb | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comment 7 CFME Bot 2015-11-18 23:18:25 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=1d0f5e9655987f0cf84d917155d285502a5bdff9

commit 1d0f5e9655987f0cf84d917155d285502a5bdff9
Author:     Lucy Fu <lufu>
AuthorDate: Wed Nov 18 12:16:57 2015 -0500
Commit:     Lucy Fu <lufu>
CommitDate: Wed Nov 18 15:31:48 2015 -0500

    Update the EMS validation for hostname so that uniqueness is not scoped to the tenant.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1276405

 app/models/ext_management_system.rb       | 2 +-
 spec/models/ext_management_system_spec.rb | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comment 8 CFME Bot 2015-11-18 23:18:32 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=cbcc3b1ea49ef165126148c3f2075d67a7bcb41f

commit cbcc3b1ea49ef165126148c3f2075d67a7bcb41f
Merge: 706befc 1d0f5e9
Author:     Greg McCullough <gmccullo>
AuthorDate: Wed Nov 18 17:28:38 2015 -0500
Commit:     Greg McCullough <gmccullo>
CommitDate: Wed Nov 18 17:28:38 2015 -0500

    Merge branch '5.5.z-provider_scope_1276405' into '5.5.z'
    
    Update the EMS validation for hostname so that uniqueness is not scoped to the tenant.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1276405
    
    Original is [here](https://github.com/ManageIQ/manageiq/pull/5497).
    Fixed a conflict in the spec.
    
    
    See merge request !499

 app/models/ext_management_system.rb       | 2 +-
 spec/models/ext_management_system_spec.rb | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comment 9 Pavol Kotvan 2015-11-30 09:52:39 UTC
Created attachment 1100413 [details]
Screenshot - warning that provider has been added already

Comment 10 Pavol Kotvan 2015-11-30 09:54:51 UTC
Verified on 5.5.0.12-rc2.20151124135609_653c0d4 appliance. Warning message is thrown when provider exists in DB already.

Comment 12 errata-xmlrpc 2015-12-08 13:42:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2015:2551