Bug 814579 - pretty.print failed to print output in non-interactive mode
Summary: pretty.print failed to print output in non-interactive mode
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: CLI
Version: 4.4
Hardware: x86_64
OS: Linux
medium
unspecified
Target Milestone: ---
: RHQ 4.10
Assignee: Jay Shaughnessy
QA Contact: Jay Shaughnessy
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-20 07:13 UTC by Filip Brychta
Modified: 2014-04-23 12:29 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-04-23 12:29:28 UTC
Embargoed:


Attachments (Terms of Use)
contains test.js and output.txt (7.08 KB, application/x-gzip)
2012-04-20 07:15 UTC, Filip Brychta
no flags Details

Description Filip Brychta 2012-04-20 07:13:26 UTC
Description of problem:
pretty.print(childResources); failed to print output however print(childResources); works correctly. See attached test.js


Version-Release number of selected component (if applicable):
Version: 4.4.0-SNAPSHOT
Build Number: ca5eecb

How reproducible:
Always

Steps to Reproduce:
1. import Linux platform resource with all child resources to your inventory
2. run ./rhq-cli.sh -u rhqadmin -p rhqadmin -f test.js > output.txt
  
Actual results:
see attached output.txt

Expected results:
output of pretty.print(childResources) should not be empty

Additional info:
test.js and output.txt attached
It seems that pretty.print fails with set of resources, for single resource works correctly.

Comment 1 Filip Brychta 2012-04-20 07:15:45 UTC
Created attachment 578884 [details]
contains test.js and output.txt

Comment 2 Charles Crouch 2012-04-23 15:37:28 UTC
Investigate for easy/hard this would be to address

Comment 3 Mike Foley 2012-04-23 16:10:54 UTC
setting priority to medium per BZ triage 4/23 (crouch, santos, oleary, foley)

Comment 4 Filip Brychta 2013-02-27 13:49:07 UTC
I run into this again today.
pretty.print failed to print PageList<ResourceOperationHistory> so the output of following code:

var resOpHistCri = new ResourceOperationHistoryCriteria();
var hist = OperationManager.findResourceOperationHistoriesByCriteria(resOpHistCri);
pretty.print(hist)

is empty.

Workaround for this is:
for(i=0;i<hist.size();i++){
	pretty.print(hist.get(i));
}

Comment 5 Jay Shaughnessy 2013-10-15 21:21:07 UTC
I tracked this down and eventually found the root cause.  I can't really explain it, must be a subtle issue with I/O.

commit 9eb9b7d8837736f0742eacf2151afb700733a2a9
Author: Jay Shaughnessy <jshaughn>
Date:   Tue Oct 15 17:17:29 2013 -0400

    Very strange issue. Replace out.print("\n") with out.println() calls
    seems to solve the problem.

Comment 6 Filip Brychta 2013-10-16 15:38:18 UTC
Verified on 
Version: 4.10.0-SNAPSHOT
Build Number: 9eb9b7d

Comment 7 Heiko W. Rupp 2014-04-23 12:29:28 UTC
Bulk closing of 4.10 issues.

If an issue is not solved for you, please open a new BZ (or clone the existing one) with a version designator of 4.10.


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