Bug 902823 - Nonsense data returned as backing content of non-content-backed resources
Nonsense data returned as backing content of non-content-backed resources
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Content (Show other bugs)
4.5
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: RHQ 4.6
Assigned To: Jirka Kremser
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-22 08:29 EST by Lukas Krejci
Modified: 2013-09-03 10:42 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-03 10:42:05 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Lukas Krejci 2013-01-22 08:29:06 EST
Description of problem:
Have a resource that can discover some content but is not in itself a content-backed resource (for example a JBoss AS 4 server, that can discover the jar files in its lib).

In CLI, call:

var id = <ID OF THE AS4 RESOURCE>
var content = ContentManager.getBackingContentForResource(id)

Version-Release number of selected component (if applicable):
4.6.0-SNAPSHOT (but the code has been incorrect since forever, with the last change to the behavior on 5th Jan 2012)

How reproducible:
always

Steps to Reproduce:
1. Wait for the content of the AS4 resource to be discovered (takes a while after it is imported to the inventory)
2. In CLI, call:

var id = <ID OF THE AS4 RESOURCE>
var content = ContentManager.getBackingContentForResource(id)

Actual results:

The content variable is non-null and contains an instance of "InstalledPackage" object pointing to one of the "jars" discovered inside the AS4 server.
  
Expected results:
The method should probably throw an exception complaining that AS4 server is not a content backed resource.

Additional info:
Comment 1 Jirka Kremser 2013-02-06 08:58:09 EST
master
http://bugzilla.redhat.com/show_bug.cgi?id=77d64e830

time:    Wed Feb 6 14:53:28 2013 +0100
commit:  77d64e8302bfe3b1df0c5e209ab7a203b10dd589
author:  Jirka Kremser - jkremser@redhat.com
message: [BZ 902823 - Nonsense data returned as backing content of non-content-backed resources] The UnsupportedOperationException is thrown when the resource is non-content-backed. I was checking also the usages of the method and it seems to be ok.
Comment 2 Jirka Kremser 2013-02-06 08:59:33 EST
the link ^^ should be http://git.fedorahosted.org/cgit/rhq/rhq.git/diff/?id=77d64e830
Comment 3 Jirka Kremser 2013-02-12 11:13:50 EST
master
http://git.fedorahosted.org/cgit/rhq/rhq.git/diff/?id=c7199465b

time:    Tue Feb 12 17:06:56 2013 +0100
commit:  c7199465b2ab8bf9cd253fdffcc278577d557a7a
author:  Jirka Kremser - jkremser@redhat.com
message: [BZ 902823 - Nonsense data returned as backing content of non-content-backed resources] Instead of throwing the exception, the null is returned. Now it's in compliance w/ the the method's jdoc.
Comment 4 Heiko W. Rupp 2013-09-03 10:42:05 EDT
Bulk closing of issues in old RHQ releases that are in production for a while now.

Please open a new issue when running into an issue.

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