Bug 918050

Summary: Missing validation of configuration when creating a new resource via CLI
Product: [Other] RHQ Project Reporter: Filip Brychta <fbrychta>
Component: CLI, PluginsAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.6CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:
Attachments:
Description Flags
configScreenshot
none
CLI script with reproduction steps none

Description Filip Brychta 2013-03-05 11:45:28 UTC
Created attachment 705365 [details]
configScreenshot

Description of problem:
It seems that validation of some fields which is done during creation of a new resource by GUI is missing when creating a new resource via CLI. So the resource is created with invalid configuration which is impossible via GUI. Concrete example would be creation of POP3 Mail Server on eap6. 

Version-Release number of selected component (if applicable):
Version: 4.7.0-SNAPSHOT
Build Number: 8beb34b

How reproducible:
Always

Steps to Reproduce:
1. eap6 standalone is imported to the inventory
2. create a new POP3 Mail Server resource via CLI with a default configuration (see attached test.js which does that)
3. check configuration of created POP3 Mail Server in GUI
  
Actual results:
POP3 Mail Server is created with invalid configuration (see attached configScreenshot)

Expected results:
POP3 Mail Server is not created and CLI client throws an exception with message containing validation errors

Additional info:
This is probably a general problem which could be probably found for configuration updates as well.

Comment 1 Filip Brychta 2013-03-05 11:47:52 UTC
Created attachment 705366 [details]
CLI script with reproduction steps

Comment 2 Filip Brychta 2013-03-05 13:12:11 UTC
Additional info:
The fact that a resource is created with invalid configuration means, that subsequent operation 'reload' on eap6 fails and eap6 fails to start up with exception 'Failed to parse configuration'. So the configuration of eap6 must be fixed manually.