Bug 494930

Summary: Can't have 2 distributions with same label in different orgs
Product: Red Hat Satellite 5 Reporter: Mike McCune <mmccune>
Component: WebUIAssignee: Justin Sherrill <jsherril>
Status: CLOSED CURRENTRELEASE QA Contact: Steve Salevan <ssalevan>
Severity: high Docs Contact:
Priority: urgent    
Version: 530CC: bperkins, cperry
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sat530 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 494929 Environment:
Last Closed: 2009-09-10 19:25:01 UTC Type: ---
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: 456998, 457075    

Description Mike McCune 2009-04-08 18:32:56 UTC
+++ This bug was initially created as a clone of Bug #494929 +++

If you setup a distribution in org 1:

f10-i386

then create another org, and in org 2 create another distro:

f10-i386

you get this when attempting to use either distro during a kickstart:

Caused by: org.hibernate.NonUniqueResultException: query did not return a unique result: 2
	at org.hibernate.impl.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:820)
	at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:811)
	at com.redhat.rhn.domain.kickstart.KickstartFactory.lookupKickstartTreeByLabel(KickstartFactory.java:527)
	at com.redhat.rhn.frontend.action.common.DownloadFile.handleKickstartDownload(DownloadFile.java:175)
	at com.redhat.rhn.frontend.action.common.DownloadFile.execute(DownloadFile.java:95)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)


Need to fix lookupKickstartTreeByLabel to require org or restrict creation of distros to be unique to the Satellite.

Comment 1 Justin Sherrill 2009-05-11 15:12:35 UTC
Should be fixed now.

13bf3a913dd5ed8dc7e3b8c03a6d875ff68881a6

Comment 2 Steve Salevan 2009-05-27 20:51:17 UTC
VERIFIED in 5/21 build.

Comment 3 Brandon Perkins 2009-07-28 21:32:01 UTC
Release Pending.  However, contrary to the bug description, we just now allow the same label in two orgs instead of throwing an exception.  So, no name collision.  This found working on  Satellite-5.3.0-RHEL5-re20090724.0-x86_64-embedded-oracle.

Comment 4 Brandon Perkins 2009-09-10 19:25:01 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html