Bug 1659947

Summary: Flash message is not proper when add Orchestration Template(Heat,Azure,VNF,vApp) with same content or name blank
Product: Red Hat CloudForms Management Engine Reporter: Niyaz Akhtar Ansari <nansari>
Component: UI - OPSAssignee: Lucy Fu <lufu>
Status: CLOSED NOTABUG QA Contact: Niyaz Akhtar Ansari <nansari>
Severity: medium Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: medium    
Version: 5.10.0CC: bmidwood, dmetzger, hkataria, lavenel, mpovolny, obarenbo, tfitzger
Target Milestone: GA   
Target Release: 5.10.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-19 15:05:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Attachments:
Description Flags
duplicate content
none
name blank error none

Description Niyaz Akhtar Ansari 2018-12-17 09:20:02 UTC
Created attachment 1515027 [details]
duplicate content

Description of problem:


Version-Release number of selected component (if applicable):
Version 5.10.0.29.20181211195209_fd990a9

How reproducible:
100%

Steps to Reproduce:
1.Add a new Orchestration Template(any Heat,Azure,VNF,vApp)
2.Again Add a another new Orchestration Template(Heat,Azure,VNF,vApp) with duplicate content[1] 


Actual results:
duplicated content error validation flash message is not proper while adding  
Orchestration Template with same content.
error message -> Error during 'Orchestration Template creation': Validation failed: ManageIQ::Providers::Azure::CloudManager::OrchestrationTemplate: Md5 of content already exists (content must be unique)


Expected results:
validation flash message should be like this => 
"Error during 'Orchestration Template creation': Validation failed: Md5 of content already exists (content must be unique)"

Additional info:
Also It show flash when we add Orchestration Template(Heat,Azure,VNF,vApp) with same name.

Comment 2 Niyaz Akhtar Ansari 2018-12-17 09:23:06 UTC
Created attachment 1515028 [details]
name blank error

Comment 3 Tina Fitzgerald 2018-12-17 22:23:07 UTC
Hi Lucy,

Could you look into this issue?

The UI code
https://github.com/ManageIQ/manageiq-ui-classic/blob/master/app/controllers/catalog_controller.rb#L1160

Calls this method:
https://github.com/ManageIQ/manageiq/blob/master/app/models/orchestration_template.rb#L156

Let me know if you have any questions.

Thanks,
Tina

Comment 4 Lucy Fu 2019-01-21 16:57:44 UTC
error message -> Error during 'Orchestration Template creation': Validation failed: ManageIQ::Providers::Azure::CloudManager::OrchestrationTemplate: Md5 of content already exists (content must be unique)

The above error message contains 3 parts.
1. Error during 'Orchestration Template creation':
  This comes from UI.

2. Validation failed: ManageIQ::Providers::Azure::CloudManager::OrchestrationTemplate: Md5
  This comes from Rails which tells the object class and attribute that fails the validation.

3. of content already exists (content must be unique)
  This comes from backend model.

We can't change the error message from Rails.

This BZ can be closed.