Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-37630

The audits:expire rake does not cleanup any templates related audits

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 6.16.z, 6.17.z
    • Audit Log
    • False
    • sat-endeavour
    • None
    • None
    • None
    • None

      The `foreman-rake audits:expire` command with or without the `days=` argument does most of the necessary cleanup of audit records as expected, but it never touches or deletes any of the audit records related to any templates.

      It's hardcoded to behave like this in https://github.com/theforeman/foreman/blob/develop/lib/tasks/audits.rake#L60-L64 

       

      Reproducible? 

      Yes

       

      Steps to reproduce :

      1. On a satellite that has been running for quite some time, execute "foreman-rake audits:expire --trace"

      2. Check the output of this query in satellite's postgres: 

      select id,auditable_id,auditable_type,action from audits;

       

      Actual Behavior :

      Any of the audits related to the auditable_type ReportTemplate, Ptable, ProvisioningTemplate, and JobTemplate are not touched or cleaned up at all. 

       

      Expected Behavior:

       

      • Secondly, depending on the arguments passed with audit expire rake, make sure that it's able to clean up those audits related to the auditable_type ReportTemplate, Ptable, ProvisioningTemplate and JobTemplate , where the template no longer exist any more. 

       

              Unassigned Unassigned
              rhn-support-saydas Sayan Das
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: