Bug 671500

Summary: EAP 5 plugin fails to detect deletion of script content
Product: [Other] RHQ Project Reporter: John Sanda <jsanda>
Component: PluginsAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED WONTFIX QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.0.0CC: jshaughn
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: 2014-07-03 15:13:18 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description John Sanda 2011-01-21 11:58:11 EST
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 15:13:18 EDT
I think again this could be an opportunity for MISSING avail. Closing though, due to no push.