Bug 814579 - pretty.print failed to print output in non-interactive mode
pretty.print failed to print output in non-interactive mode
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: CLI (Show other bugs)
4.4
x86_64 Linux
medium Severity unspecified (vote)
: ---
: RHQ 4.10
Assigned To: Jay Shaughnessy
Jay Shaughnessy
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-20 03:13 EDT by Filip Brychta
Modified: 2014-04-23 08:29 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-04-23 08:29:28 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Filip Brychta 2012-04-20 03:13:26 EDT
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 03:15:45 EDT
Created attachment 578884 [details]
contains test.js and output.txt
Comment 2 Charles Crouch 2012-04-23 11:37:28 EDT
Investigate for easy/hard this would be to address
Comment 3 Mike Foley 2012-04-23 12:10:54 EDT
setting priority to medium per BZ triage 4/23 (crouch, santos, oleary, foley)
Comment 4 Filip Brychta 2013-02-27 08:49:07 EST
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 17:21:07 EDT
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@redhat.com>
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 11:38:18 EDT
Verified on 
Version: 4.10.0-SNAPSHOT
Build Number: 9eb9b7d
Comment 7 Heiko W. Rupp 2014-04-23 08:29:28 EDT
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.