Issue #19474 has been updated by Andrew Parker.
Status changed from Unreviewed to Accepted
Keywords set to create_resources
Just a clarification because it took me a bit to figure out why the resource
declaration was rejected by the compiler: a resource reference is the
capitalized form of the resource type name, where each component (`::`
separated) must be capitalized. So instead of:
<pre>
file { '/tmp/foo':
ensure => present,
require => [ Mymodule::foo['bar'] ],
}
</pre>
it should be
<pre>
file { '/tmp/foo':
ensure => present,
require => [ Mymodule::Foo['bar'] ],
}
</pre>
Note the change from `::foo` to `::Foo`.
----------------------------------------
Bug #19474: Using create_resource or some other Ruby methodology for creating
resources allows for invalid resource references
https://projects.puppetlabs.com/issues/19474#change-94680
* Author: Ken Barber
* Status: Accepted
* Priority: Normal
* Assignee:
* Category:
* Target version:
* Affected Puppet version: 3.1.0
* Keywords: create_resources
* Branch:
----------------------------------------
See #17842 for an example of this:
<http://projects.puppetlabs.com/issues/17842#note-5>
The problem is that this is invalid in the parser:
file { '/tmp/foo':
ensure => present,
require => [ Mymodule::foo['bar'] ],
}
But this works successfully:
create_resources('file', {
'/usr/local/homeaway/api-favorites-ustst1-jdk/java' => { ensure => present,
require => "Mymodule::foo[bar]" }})
However, in PuppetDB we are more strict and the second case fails with an
invalid relationship error - we can fix the error message on our end, but this
still shouldn't be allowed I believe.
The question is - should this be fixed in the internals so people tapping
resource creation (like within create_resources) get an error or something
else? Or perhaps fixed in create_resources? Its basically just an inconsistency
between that methodology and what the parser enforces.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.