Bug 671500 - EAP 5 plugin fails to detect deletion of script content
Summary: EAP 5 plugin fails to detect deletion of script content
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 4.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: RHQ Project Maintainer
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-21 16:58 UTC by John Sanda
Modified: 2014-07-03 19:13 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-03 19:13:18 UTC
Embargoed:


Attachments (Terms of Use)

Description John Sanda 2011-01-21 16:58:11 UTC
Description of problem:
The EAP 5 plugin supports managing various scripts that are part of the EAP distro. Scripts are content backed resources which among other things means that when viewing the script in the UI, the Content tab will be visible and accessible. During content discovery the plugin container will call the discoverDeployedPackages method of each plugin component that implements the ContentFacet. The plugin component class in this case is ScriptComponent.

If no content/packages are found, discoverDeployedPackages should return an
empty set. Then the plugin container would compare those results against the
current, known deployed content at which point it would determine that content
has been deleted. These results would be sent up to the server and an
appropriate entry would be logged in the package history for script file
indicating that the content is not available.

When a script has been deleted, ScriptComponent.discoverDeployPackages generates a FileNotFoundException when it tries to calculate the SHA-256 sum for the file. It swallows the exception and returns the ResourcePackageDetails for the deleted script. It should instead be returning an empty set which would tell the plugin container that the script is deleted.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Get an EAP 5 instance into inventory
2. Manually delete <jboss_home>/bin/twiddle.sh
3. Wait 5 minutes or so to give content discovery a chance to run
  
Actual results:
twiddle.sh will have an availability of DOWN but nothing in the package history indicating that the script is missing.

Expected results:
There should be an entry in the package history indicating that the script is no longer available. More specifically, the entry should have a status of MISSING.

Additional info:
This bug is very similar to bug 671496 in how it manifests itself. I've logged it separately though since it involves different plugin component classes.

Comment 1 Jay Shaughnessy 2014-07-03 19:13:18 UTC
I think again this could be an opportunity for MISSING avail. Closing though, due to no push.


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