Bug #10539
Referencing a class does not validate until it is consume in a `require` like metaparameter
| Status: | Accepted | Start date: | 11/03/2011 | |
|---|---|---|---|---|
| Priority: | High | Due date: | ||
| Assignee: | - | % Done: | 0% | |
| Category: | language | |||
| Target version: | - | |||
| Affected Puppet version: | 2.7.6 | Branch: | ||
| Keywords: | ||||
Description
From the original report:
I had a typo in my require default line which didn’t raise any sort of error until I added to a specific resource. That is I had
$require = Class["apps::postgres::multi"]when there was no such class (the class was namedapps::postgresql::multi) and this did not raise an error.I found the typo when I had an ordering issue and tried adding the
require => Class["apps::postgres::multi"]to a specific resource and this generated the error “err: Failed to apply catalog: Could not find dependency Class …”.It should generate the ‘could not find dependency’ error for the default.
I have verified this: assigning a reference to a type does absolutely not validation in Puppet 2.7, including when the content is consumed in some cases:
$foo = Class["foo"]
$bar = Banana["bar"] # note: no such type!
notice("hello, $foo, from your little $bar")
Instead, the referenced type and entity should be validated during compilation, so that a clear error occurs when you reference a non-existent anything – not just when that value would be consumed in a way that dereferences the dependency.
History
#1
Updated by Daniel Pittman over 1 year ago
- Subject changed from require metaparameter default does not raise an error to Referencing a class does not validate until it is consume in a `require` like metaparameter
- Description updated (diff)
- Category set to language
- Status changed from Unreviewed to Needs Decision
- Assignee set to Randall Hansen
Randall, this is assigned to you because the key priority decision is around the UX failure here, I think. Can you work out what priority this has, and what it targets, please?
#2
Updated by Randall Hansen over 1 year ago
- Status changed from Needs Decision to Accepted
- Priority changed from Normal to High
- Target version set to 2.7.11
#3
Updated by Randall Hansen over 1 year ago
- Assignee changed from Randall Hansen to Daniel Pittman
#4
Updated by Matthaus Owens about 1 year ago
- Target version changed from 2.7.11 to 2.7.x
#5
Updated by Andrew Parker 6 months ago
- Target version deleted (
2.7.x)
#6
Updated by Daniel Pittman 14 days ago
- Assignee deleted (
Daniel Pittman)