Bug 808220 - with CLI, programmatically creating a group and putting 1 member in it creates a mixed group instead of a compatible group
Summary: with CLI, programmatically creating a group and putting 1 member in it create...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: CLI
Version: 4.4
Hardware: Unspecified
OS: Unspecified
unspecified
high vote
Target Milestone: ---
: RHQ 4.4.0
Assignee: Jay Shaughnessy
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-29 20:52 UTC by Mike Foley
Modified: 2013-09-01 10:12 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-01 10:12:59 UTC


Attachments (Terms of Use)
CLI script reproducing the issue (1.77 KB, application/javascript)
2012-03-29 20:52 UTC, Mike Foley
no flags Details

Description Mike Foley 2012-03-29 20:52:50 UTC
Created attachment 573795 [details]
CLI script reproducing the issue

Description of problem:  with CLI, programmatically creating a group and putting 1 member in it creates a mixed group instead of a compatible group


Version-Release number of selected component (if applicable):  RHQ 4.4


How reproducible:
100%

Steps to Reproduce:
1. ./rhq-cli.sh -u rhqadmin -p rhqadmin -f attachment1 [details].js
2. verify thru the UI that a mixed group was created and that it contains the platform  
3. verify through SQL (SELECT NAME, RECURSIVE, CATEGORY FROM RHQ_RESOURCE_GROUP;)  that the group is a non-recursive mixed group
  
Actual results:  non-recursive mixed group


Expected results:  the expectation is that this creates a compatible group.  this is required for 2 reasons:  1) CLI Automation, 2) CLI scripts a customer may write to do bundle deployments programmatically thru the CLI.


Additional info:

Comment 1 Mike Foley 2012-03-29 20:53:34 UTC
error message


[mfoley@foleymonsterbox1 bin]$ ./rhq-cli.sh -u rhqadmin -p rhqadmin -f /home/mfoley/automation2/automatjon/jon//clitest/resources/js-files/bundlemanager.js 
Remote server version is: 4.4.0-SNAPSHOT (969ed45)
Login successful
Exception in thread "main" org.rhq.enterprise.client.script.CLIScriptException: javax.script.ScriptException: sun.org.mozilla.javascript.WrappedException: Wrapped javax.ejb.EJBException: [Warning] java.lang.IllegalArgumentException: Invalid groupId [10013]. It must be an existing compatible group whose members must be able to support bundle deployments (<Unknown source>#51) in <Unknown source> at line number 51
	at org.rhq.enterprise.client.commands.ScriptCommand.executeScriptFile(ScriptCommand.java:298)
	at org.rhq.enterprise.client.commands.ScriptCommand.execute(ScriptCommand.java:108)
	at org.rhq.enterprise.client.ClientMain$StartupConfiguration.process(ClientMain.java:142)
	at org.rhq.enterprise.client.ClientMain.main(ClientMain.java:162)
Caused by: javax.script.ScriptException: sun.org.mozilla.javascript.WrappedException: Wrapped javax.ejb.EJBException: [Warning] java.lang.IllegalArgumentException: Invalid groupId [10013]. It must be an existing compatible group whose members must be able to support bundle deployments (<Unknown source>#51) in <Unknown source> at line number 51

Comment 2 Jay Shaughnessy 2012-03-30 21:13:58 UTC
master commit daec885053b6679e4bb6a80c7c8dc86c75868a4b

The following ResourceGroupManager API methods now recalculate group type
when they are done:

- addResourceToGroup()
- removeResourcesFromGroup()
- updateGroup() // when using the updateMembers option

Comment 3 Heiko W. Rupp 2013-09-01 10:12:59 UTC
Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since.


Note You need to log in before you can comment on or make changes to this bug.