diff options
author | Matt Robinson <matt@puppetlabs.com> | 2011-05-19 21:18:55 -0700 |
---|---|---|
committer | Matt Robinson <matt@puppetlabs.com> | 2011-05-19 21:18:55 -0700 |
commit | eeeab02fd97a625ec0e21ecd5d0ed7f0067027ef (patch) | |
tree | 704477b4d8c2b255707e65135b3bb0d10253e06c /lib/puppet/parser/compiler.rb | |
parent | be2f20899d76621db4cf574d074f0ae89777272e (diff) | |
parent | 99bf07e76bab47760b9eb3dc42f08582c568388f (diff) | |
download | puppet-eeeab02fd97a625ec0e21ecd5d0ed7f0067027ef.tar.gz puppet-eeeab02fd97a625ec0e21ecd5d0ed7f0067027ef.tar.xz puppet-eeeab02fd97a625ec0e21ecd5d0ed7f0067027ef.zip |
Merge branch '2.7.next' into 2.7.x
* 2.7.next: (42 commits)
(#6395) Add extpuppet help, eval, and interfaces
Adding a sleep state post starting master
maint: fix spec_helper inclusions again.
(#7523) Refactor the grammar to reduce duplication
(#7114) Fix specs for ssh authorized key parsed provider
(#7114) Target returns correct value
(#7114) Add integration tests for authorized_key
(#7114) Improve unit tests for ssh_authorized_key
(#7114) Improve value validation for authorized_key
(#7300) Fix instances method of mount provider
(#7259) Remove ActiveRecord requirement from indirector face spec
(#7259) Do not try to load all Terminus classes when configuring the Indirector
(#3836) External nodes should only capture stdout
Revert "(#7220) Add the ability to "inherit" options."
maint: sync 'authconfig' to 'rest_authconfig' setting
adding test for ticket 7139
(#7139) Accept '/' as a valid path in filesets
(#7300) Add specs for the mount provider
case seems needless here as there is only two opts, also the rest of the file seems to use if so this should make things more consistant
(#6845) Mount writes incorrect vfstab entries
...
Diffstat (limited to 'lib/puppet/parser/compiler.rb')
-rw-r--r-- | lib/puppet/parser/compiler.rb | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb index a891f1a11..613fcae74 100644 --- a/lib/puppet/parser/compiler.rb +++ b/lib/puppet/parser/compiler.rb @@ -56,23 +56,20 @@ class Puppet::Parser::Compiler # Note that this will fail if the resource is not unique. @catalog.add_resource(resource) + if resource.type.to_s.downcase != "class" && resource[:stage] + raise ArgumentError, "Only classes can set 'stage'; normal resources like #{resource} cannot change run stage" + end - # Add our container edge. If we're a class, then we get treated specially - we can - # control the stage that the class is applied in. Otherwise, we just - # get added to our parent container. + # Stages should not be inside of classes. They are always a + # top-level container, regardless of where they appear in the + # manifest. return if resource.type.to_s.downcase == "stage" + # This adds a resource to the class it lexically appears in in the + # manifest. if resource.type.to_s.downcase != "class" - raise ArgumentError, "Only classes can set 'stage'; normal resources like #{resource} cannot change run stage" if resource[:stage] return @catalog.add_edge(scope.resource, resource) end - - unless stage = @catalog.resource(:stage, resource[:stage] || (scope && scope.resource && scope.resource[:stage]) || :main) - raise ArgumentError, "Could not find stage #{resource[:stage] || :main} specified by #{resource}" - end - - resource[:stage] ||= stage.title unless stage.title == :main - @catalog.add_edge(stage, resource) end # Do we use nodes found in the code, vs. the external node sources? |