Bug 864936

Summary: Product labels are not currently required to be unique.
Product: Red Hat Satellite Reporter: Brad Buckingham <bbuckingham>
Component: WebUIAssignee: Brad Buckingham <bbuckingham>
Status: CLOSED ERRATA QA Contact: Corey Welton <cwelton>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.1CC: achan, mmccune, omaciel, tlestach
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously, a product label can be reused by another product in the same provider or organization. A unique label is now required for all products within the same organization. Using a duplicate label for different products in the same organization will generate an error.
Story Points: ---
Clone Of:
: 874744 (view as bug list) Environment:
Last Closed: 2012-12-04 19:57:07 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:
Bug Depends On:    
Bug Blocks: 874744    

Description Brad Buckingham 2012-10-10 12:31:47 UTC
Description of problem:

When creating a product for a provider, the user may set the product label to a value that is already used by another product in that provider or organization.

Should product labels be unique?  Note: The product label is included as part of the client's redhat.repo (e.g. [orglabel_productlabel_repolabel]).

If we need the labels to be unique, we'll need to ensure that the algorithm used for auto-setting them takes this in to account (e.g. label+dbid).  This will be necessary for both creation of custom products as well as those created as part of a manifest import.

Version-Release number of selected component (if applicable):
github master

How reproducible:
always

Steps to Reproduce:

1. Attempt to create multiple products with the same label.
  
Actual results:

katello> product create --org ACME_Corporation --provider prov1 --name product1 --label product1
Successfully created product [ product1 ]

katello> product create --org ACME_Corporation --provider prov1 --name product1 --label product1
Successfully created product [ product1 ]


Expected results:

Second product create should fail.

Additional info:

Comment 3 Brad Buckingham 2012-11-02 21:42:20 UTC
katello github pull request : https://github.com/Katello/katello/pull/991

The above pull request ensures that product labels are unique within the organization where the product is created.  The following is the high-level behavior:

- UI:
  - If the user submits a request to create a product and and the request does not include a label, a unique label will be created and assigned. The user will be informed with a 'message' notice.
  - If the user submits a request to create a product and the request includes a label that has already been assigned to a product in that organization, a unique label will be created and assigned. The user will be informed with a 'message' notice.
  - If the user submits a request to create a product and the request includes a unique label, that label is assigned to the product.

- API/CLI:
  - If the user submits a request to create a product and the request does not include a label, a unique label will be created and assigned.
  - If the user submits a request to create a product and the request includes a label that has already been assigned to a product in that organization, a validation error is returned.
  - If the user submits a request to create a product and the request includes a unique label, that label is assigned to the product.

Comment 6 Corey Welton 2012-11-06 16:53:27 UTC
QE Verified:

cfse> product create --org Test_Org_1352219207 --provider "Google Products_provider" --name product1 --label product1
Successfully created product [ product1 ]
cfse> product create --org Test_Org_1352219207 --provider "Google Products_provider" --name product1 --label product1
Validation failed: Label has already been taken


CloudForms System Engine Version: 1.1.12-20.el6cf

Comment 8 errata-xmlrpc 2012-12-04 19:57:07 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.

http://rhn.redhat.com/errata/RHSA-2012-1543.html

Comment 9 Mike McCune 2013-08-16 18:18:36 UTC
getting rid of 6.0.0 version since that doesn't exist

Comment 10 Tomas Lestach 2014-06-05 10:11:12 UTC
A very similar issue discovered in 6.0.3: Bug 1105061