summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-28 06:46:43 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-02-28 06:46:43 +0000
commitcc260268a88f69a6bb28535b17ced7228aa71314 (patch)
treeb98a11a6abfc9fe2786a34a94eceb166a940db6b /lib
parentd229d49c5614c5ca9e15ae5716968a184f6f1bc7 (diff)
downloadpuppet-cc260268a88f69a6bb28535b17ced7228aa71314.tar.gz
puppet-cc260268a88f69a6bb28535b17ced7228aa71314.tar.xz
puppet-cc260268a88f69a6bb28535b17ced7228aa71314.zip
Fixing #467. It is a hackish solution, because I just reordered the definition of the params, but it works for now, anyway.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2242 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/metatype/metaparams.rb42
1 files changed, 22 insertions, 20 deletions
diff --git a/lib/puppet/metatype/metaparams.rb b/lib/puppet/metatype/metaparams.rb
index b780316af..2294f6170 100644
--- a/lib/puppet/metatype/metaparams.rb
+++ b/lib/puppet/metatype/metaparams.rb
@@ -308,8 +308,12 @@ class Puppet::Type
RelationshipMetaparam.subclasses
end
- # For each object we require, subscribe to all events that it generates. We
- # might reduce the level of subscription eventually, but for now...
+
+ # Note that the order in which the relationships params is defined
+ # matters. The labelled params (notify and subcribe) must be later,
+ # so that if both params are used, those ones win. It's a hackish
+ # solution, but it works.
+
newmetaparam(:require, :parent => RelationshipMetaparam, :attributes => {:direction => :in, :events => :NONE}) do
desc "One or more objects that this object depends on.
This is used purely for guaranteeing that changes to required objects
@@ -346,8 +350,6 @@ class Puppet::Type
"
end
- # For each object we require, subscribe to all events that it generates.
- # We might reduce the level of subscription eventually, but for now...
newmetaparam(:subscribe, :parent => RelationshipMetaparam, :attributes => {:direction => :in, :events => :ALL_EVENTS, :callback => :refresh}) do
desc "One or more objects that this object depends on. Changes in the
subscribed to objects result in the dependent objects being
@@ -368,22 +370,6 @@ class Puppet::Type
refreshing.
"
end
-
- newmetaparam(:notify, :parent => RelationshipMetaparam, :attributes => {:direction => :out, :events => :ALL_EVENTS, :callback => :refresh}) do
- desc %{This parameter is the opposite of **subscribe** -- it sends events
- to the specified object:
-
- file { "/etc/sshd_config":
- source => "....",
- notify => service[sshd]
- }
-
- service { sshd:
- ensure => running
- }
-
- This will restart the sshd service if the sshd config file changes.}
- end
newmetaparam(:before, :parent => RelationshipMetaparam, :attributes => {:direction => :out, :events => :NONE}) do
desc %{This parameter is the opposite of **require** -- it guarantees
@@ -404,6 +390,22 @@ class Puppet::Type
This will make sure all of the files are up to date before the
make command is run.}
end
+
+ newmetaparam(:notify, :parent => RelationshipMetaparam, :attributes => {:direction => :out, :events => :ALL_EVENTS, :callback => :refresh}) do
+ desc %{This parameter is the opposite of **subscribe** -- it sends events
+ to the specified object:
+
+ file { "/etc/sshd_config":
+ source => "....",
+ notify => service[sshd]
+ }
+
+ service { sshd:
+ ensure => running
+ }
+
+ This will restart the sshd service if the sshd config file changes.}
+ end
end # Puppet::Type
# $Id$