Bug 808220 - with CLI, programmatically creating a group and putting 1 member in it creates a mixed group instead of a compatible group
with CLI, programmatically creating a group and putting 1 member in it create...
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: CLI (Show other bugs)
4.4
Unspecified Unspecified
unspecified Severity high (vote)
: ---
: RHQ 4.4.0
Assigned To: Jay Shaughnessy
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-29 16:52 EDT by Mike Foley
Modified: 2013-09-01 06:12 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-01 06:12:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Mike Foley 2012-03-29 16:52:50 EDT
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 16:53:34 EDT
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 17:13:58 EDT
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 06:12:59 EDT
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.