Comment 1 for bug 1519210

Fernando Diaz (diazjf) wrote :

Hey Steve, how does something like this look:

notifications.py
------------------------

Add:
enabled_events = {}

which will read from the conf and eventually generate something like:

enabled_events = {
    "resource_type": {'user', 'group'},
    "operation": {ACTIONS.created}
}

and in:
def _create_cadf_payload(operation, resource_type, resource_id,
                         outcome, initiator):

we add:
if resource_type in enabled_events.get("resource_type") and \
                    operation in enabled_events.get("operation"):

to the top of the function.