Bug 1302026

Summary: Unique deployment name validation not working, page refresh needed
Product: Red Hat Quickstart Cloud Installer Reporter: Antonin Pagac <apagac>
Component: WebUIAssignee: Erik Nelson <ernelson>
Status: CLOSED ERRATA QA Contact: Thom Carlin <tcarlin>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.0CC: ernelson, tcarlin, tpapaioa
Target Milestone: gaKeywords: 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-09-13 16:24:48 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:
Bug Depends On:    
Bug Blocks: 1342594    

Description Antonin Pagac 2016-01-26 14:40:19 UTC
Description of problem:
I'm able to create a deployment with non-unique name, and when proceeding, it produces and error 422 in production.log:

2016-01-26 09:21:20 [I]   Parameters: {"deployment"=>{"name"=>"apagac-fake", "description"=>nil, "deploy_rhev"=>true, "deploy_cfme"=>false, "deploy_openstack"=>false, "is_disconnected"=>false, "rhev_is_self_hosted"=>false, "rhev_engine_admin_password"=>"[FILTERED]", "rhev_database_name"=>"Default", "rhev_cluster_name"=>"Default", "rhev_storage_name"=>"my_storage", "rhev_storage_type"=>"NFS", "rhev_storage_address"=>nil, "rhev_cpu_type"=>nil, "rhev_share_path"=>nil, "cfme_install_loc"=>nil, "rhev_root_password"=>"[FILTERED]", "cfme_root_password"=>"[FILTERED]", "cfme_admin_password"=>"[FILTERED]", "foreman_task_uuid"=>nil, "upstream_consumer_uuid"=>nil, "upstream_consumer_name"=>nil, "rhev_export_domain_name"=>"my_export", "rhev_export_domain_address"=>nil, "rhev_export_domain_path"=>nil, "rhev_local_storage_path"=>nil, "rhev_gluster_node_name"=>nil, "rhev_gluster_node_address"=>nil, "rhev_gluster_ssh_port"=>nil, "rhev_gluster_root_password"=>"[FILTERED]", "host_naming_scheme"=>nil, "custom_preprend_name"=>nil, "enable_access_insights"=>false, "cfme_address"=>nil, "cfme_hostname"=>nil, "openstack_undercloud_password"=>"[FILTERED]", "openstack_undercloud_ip_addr"=>nil, "openstack_undercloud_user"=>nil, "openstack_undercloud_user_password"=>"[FILTERED]", "openstack_undercloud_hostname"=>nil, "openstack_overcloud_hostname"=>nil, "openstack_overcloud_address"=>nil, "openstack_overcloud_password"=>"[FILTERED]", "openstack_overcloud_private_net"=>nil, "openstack_overcloud_float_net"=>nil, "openstack_overcloud_float_gateway"=>nil, "cdn_url"=>nil, "manifest_file"=>nil, "created_at"=>nil, "updated_at"=>nil, "rhev_engine_host_id"=>nil, "organization_id"=>"1", "lifecycle_environment_id"=>nil, "discovered_host_id"=>nil, "foreman_task_id"=>nil}, "api_version"=>"v21"}
2016-01-26 09:21:20 [I] Completed 422 Unprocessable Entity in 22ms (Views: 15.6ms | ActiveRecord: 0.6ms)

No error in UI is visible. For the name validation to work, page must be refreshed between adding two deployments with the same name. See reproducer steps.

Version-Release number of selected component (if applicable):
RHCI-6.0-RHEL-7-20160122.t.1-RHCI-x86_64-dvd1.iso
Firefox 43.0.3

How reproducible:
Always

Steps to Reproduce:
1. Create a new deployment. Product does not matter
2. Go to step 1D, then choose Cancel and Exit&Save
3. Click on New Deployment
4. Create a new deployment. Name it exactly as you did the first one.
5. The next button is visible, you can click on it; it will allow you to proceed to the step 1C, and then when clicked will generate an 422 error in production log.

Actual results:
User is able to create a deployment with non-unique name

Expected results:
User should not be allowed to create a deployment with non-unique name

Additional info:
This does not happen if you refresh the page between 2nd and 3rd reproducer step.

Comment 1 Erik Nelson 2016-06-22 14:02:21 UTC
This has been fixed as a result of ongoing development.

Comment 2 Thom Carlin 2016-07-05 13:45:12 UTC
Verified in QCI 1.2:

"This name is already in use.
generated label "<<deployment_name>>" is not unique"

Comment 8 errata-xmlrpc 2016-09-13 16:24:48 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/RHEA-2016:1862