Bug 728965

Summary: CLI: Division by zero in TabularWriter.print()
Product: [Other] RHQ Project Reporter: Ondřej Žižka <ozizka>
Component: CLIAssignee: RHQ Project Maintainer <rhq-maint>
Status: NEW --- QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 3.0.1CC: 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: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Ondřej Žižka 2011-08-08 09:58:42 EDT
rhqadmin@stacks1.mw.lab.eng.bos.redhat.com:7080$ var criteria = new ResourceCriteria();

rhqadmin@stacks1.mw.lab.eng.bos.redhat.com:7080$ criteria.addFilterInventoryStatus( InventoryStatus.COMMITTED );

rhqadmin@stacks1.mw.lab.eng.bos.redhat.com:7080$ criteria.addFilterResourceCategory( ResourceCategory.PLATFORM );

rhqadmin@stacks1.mw.lab.eng.bos.redhat.com:7080$ criteria.addFilterResourceTypeName("Linux");

rhqadmin@stacks1.mw.lab.eng.bos.redhat.com:7080$ var linuxesList = ResourceManager.findResourcesByCriteria(criteria);

rhqadmin@stacks1.mw.lab.eng.bos.redhat.com:7080$ println("Uninventorizing Linux: " + linuxesList.get(0) );
Uninventorizing Linux: Resource[id=10701, type=Linux, key=stacks2.mw.lab.eng.bos.redhat.com, name=stacks2.mw.lab.eng.bos.redhat.com, parent=<null>, version=Linux 2.6.32-131.0.15.el6.i686]

rhqadmin@stacks1.mw.lab.eng.bos.redhat.com:7080$
rhqadmin@stacks1.mw.lab.eng.bos.redhat.com:7080$ ResourceManager.uninventoryResources( [linuxesList.get(0)] );
sun.org.mozilla.javascript.internal.EvaluatorException: Cannot convert sun.org.mozilla.javascript.internal.NativeArray@1389b3f to int[]
ResourceManager.uninventoryResources( [linuxesList.get(0)] );
^

rhqadmin@stacks1.mw.lab.eng.bos.redhat.com:7080$ ResourceManager.uninventoryResources( [linuxesList.get(0).id] );
java.lang.ArithmeticException: / by zero
        at org.rhq.enterprise.client.TabularWriter.print(TabularWriter.java:555)
        at org.rhq.enterprise.client.TabularWriter.print(TabularWriter.java:343)
        at org.rhq.enterprise.client.TabularWriter.print(TabularWriter.java:123)
        at org.rhq.enterprise.client.commands.ScriptCommand.execute(ScriptCommand.java:177)
        at org.rhq.enterprise.client.ClientMain.executePromptCommand(ClientMain.java:303)
        at org.rhq.enterprise.client.ClientMain$1.run(ClientMain.java:248)
        at java.lang.Thread.run(Thread.java:662)