Feature #1717

Improve smart-variable unassignment during a puppetclass removal

Added by Olivier Favre 11 months ago. Updated 11 months ago.

Status:Assigned Start:06/28/2012
Priority:Normal Due date:
Assigned to:Olivier Favre % Done:

0%

Category:Smart Variables
Target version:- Estimated time:2.00 hours
Backlog:No Difficulity:medium
Votes: 0

Description

Smart-variables contain a lot of configuration we do not want to loose.
When a puppet class is deleted, the associated smart-variable are indeed not suppressed.
But the old puppetclass' id is still stored in the database.

NULL should be stored instead inside puppetclass_id.
Additionally, we should keep track of the last assigned puppetclass' name (when unassigning), as this would help identifying them.

History

Updated by Ohad Levy 11 months ago

cant we use auditing for that (instead of storing the class name?)

Updated by Olivier Favre 11 months ago

  • Status changed from New to Assigned
  • Assigned to set to Olivier Favre
  • Estimated time changed from 1.00 to 2.00
  • Difficulity changed from easy to medium

Updated by Olivier Favre 11 months ago

Ohad Levy wrote:

cant we use auditing for that (instead of storing the class name?)

Does that imply?:
  1. auditing puppetclass-lookup_keys association
  2. making a search in the audits if lookup_key.puppetclass == nil, extracting the name from the audits

We can make a second search in the audits to see the last destroy action associated with the old puppetclass id, but that assumes ids are never reused.

If this assumption does not hold, we would need to store the puppetclass name at the time of the dissociation, inside the audit record.

Also available in: Atom PDF