Red Hat Bugzilla – Bug 649318
need way to provide further audit msgs during bundle provisioning
Last modified: 2013-09-02 03:22:44 EDT
While the ant recipe is executed, certain build events trigger audit log messages to get persisted (that is, you'll see different "steps" in the bundle deployment audit trail).
It would be nice if someone writing an ant recipe can trigger their own custom audit trail logs/msgs.
For example, today we don't log anything when this is called:
So when ant logs a message, we don't put it in the audit trail. This may or may not be what we want. However, we would like to do something to provide a hook for recipe authors to be able to use to log their own messages - and whether or not the audit step was a "SUCCESS" or "FAILURE".
We could do something like detect when the <echo> task emitted something and log that. Or we could write our own custom "rhq:audit" task to provide a RHQ specific way of doing this. for example:
The audit message goes here.
We could support an optional attribute "message" such that it could look like:
<rhq:audit result="SUCCESS" message="The audit message goes here." />
The value of "result" attribute must be either SUCCESS or FAILURE.
master commit 65c741a60042218f7ab290b4795b563c9be2c77e
new rhq:audit task lets you send up a custom audit trail entry from within your ant bundle recipe:
status is one of SUCCESS, FAILURE, WARN
action is a short name of your audit step (e.g. "Set File Permissions")
info is a short summary, sometimes the target of the action (e.g. "file.txt")
message is a short message, usually 1 or 2 lines (e.g. "permissions set on file at 1:00pm")
details is a long message. will show in a textarea in the UI
To test, put this in a recipe's preinstall or postinstall target - deploy the bundle - go to the deployment view and look at the deployment history and see your audit trail.
Verified on build#123 (Version: 4.1.0-SNAPSHOT Build Number: a6d2d56)
Created a recipe and included below in postinstall target:
<rhq:audit status="SUCCESS" action="Test action: Deploy Files From URLS" info="This is to test the Info in audit status" message="Test Message for deploying files from URLS">
The test details goes here....
Created and deployed the bundle. Navigated to the deployment history and verified the audit messages in audit trail.
Please refer the attached screenshot.
Marking as verified.
Created attachment 504645 [details]
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.