Bug 1284820

Summary: No error printed when creating a lifecycle environment with the same name in step 1C
Product: Red Hat Quickstart Cloud Installer Reporter: Antonin Pagac <apagac>
Component: WebUIAssignee: Dylan Murray <dymurray>
Status: CLOSED CURRENTRELEASE QA Contact: Dave Johnson <dajohnso>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.0CC: arubin, dymurray, jmatthew
Target Milestone: TP2Keywords: Triaged
Target Release: 1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-03 19:00:27 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: 1291836    

Description Antonin Pagac 2015-11-24 09:50:39 UTC
Description of problem:
While doing a deployment, in step 1C "Configure Lifecycle Environment" I choose to create new environment path by clicking on a button "New Environment Path". In the dialog I then choose a name and submitted, this worked fine. I then clicked on the "New Environment Path" button again, creating and submitting environment path with the same name as before, no error or warning appeared. I clicked the Next button, got to step 1D "Access Insights" and this error appeared under my deployment name:

error saving environmentError: The backend rejected the commit because it was invalid: {name: of environment must be unique within one organization, label: of environment must be unique within one organization}

We should check if the name of a created environment path is unique, and if not, we should print a warning/error preferably in the New Environment Path pop-up dialog. For example, checking deployment name is implemented this way.

Version-Release number of selected component (if applicable):
RHCI-6.0-RHEL-7-20151118.t.0-RHCI-x86_64-dvd1.iso

How reproducible:
Always

Steps to Reproduce:
1. Start a new deployment, go to step 1C
2. Choose to create New Environment Path, submit a valid name
3. Choose to create New Environment Path again, submit the same name as before, no error appears
4. Click Next, in step 1D the above error appears

Actual results:
I got to next step before seeing an error about the unique environment path name

Expected results:
I should see the error in step 1C, I should not be allowed to submit environment path with non-unique name

Additional info:

Comment 1 Dylan Murray 2016-01-11 21:37:52 UTC
PR: https://github.com/fusor/fusor/pull/614

Added check before environment name is saved which would cause problems if the names are not unique because it tries overwriting the . Now an error is printed on 1C explaining that the environment name is not unique.

Comment 2 Antonin Pagac 2016-01-25 14:19:56 UTC
Verified.

TP2 RC3
RHCI-6.0-RHEL-7-20160122.t.1-RHCI-x86_64-dvd1.iso