HomePhorge

(PUP-2298) add resource lifecycle method Puppet::Type#pre_run_check
3041c2cdee4bUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(PUP-2298) add resource lifecycle method Puppet::Type#pre_run_check

In order to deprecate the builtin defined function (which is often abused
to work around resource duplication among modules) it is desirable to
add resource constraints to the language. An easy approach to allowing such
constraints to work is to add them as a special resource type that does not
take effect during the transaction, but fails the whole catalog in case of
validation failure.

To make this possible, add a new method #pre_run_check to the Type base class
for overriding in appropriate resource types (such as constraint).

The semantics is simply

  • raise nothing if the pre-run check is succesful
  • raise a Puppet::Error otherwise

The check is performed during evaluation of the transaction, just before
the catalog is applied. The generating of additional resources should be
complete when this is done (because the hook is meant to be able to
check the whole catalog for consistency).

Details

Provenance
Felix Frank <Felix.Frank@Alumni.TU-Berlin.de>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU90aad3fff7d2: Merge remote-tracking branch 'origin/stable'
Branches
Unknown
Tags
Unknown

Event Timeline

Felix Frank <Felix.Frank@Alumni.TU-Berlin.de> committed rPU3041c2cdee4b: (PUP-2298) add resource lifecycle method Puppet::Type#pre_run_check (authored by Felix Frank <Felix.Frank@Alumni.TU-Berlin.de>).May 14 2014, 11:38 PM