diff options
| author | Luke Kanies <luke@madstop.com> | 2008-03-06 14:47:14 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-03-06 14:47:14 -0600 |
| commit | 35214eb7e2887ed4ab7e4ab0d8c92c724db495d2 (patch) | |
| tree | 223adf6b353ac780b4850ba052fe4b5b27ca2135 | |
| parent | 2261032801a39affa1a4c5e998fc2c4dd145503f (diff) | |
Fixing the rest of #1113: External node commands can specify
an environment and Puppet will now use it.
| -rw-r--r-- | CHANGELOG | 3 | ||||
| -rw-r--r-- | lib/puppet/indirector/node/exec.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/indirector/node/exec.rb | 6 |
3 files changed, 10 insertions, 1 deletions
@@ -1,3 +1,6 @@ + Fixing the rest of #1113: External node commands can specify + an environment and Puppet will now use it. + Partially fixing #1113: LDAP nodes now support environments, and the schema has been updated accordingly. diff --git a/lib/puppet/indirector/node/exec.rb b/lib/puppet/indirector/node/exec.rb index ed76bce94..71f4fa8e1 100644 --- a/lib/puppet/indirector/node/exec.rb +++ b/lib/puppet/indirector/node/exec.rb @@ -30,7 +30,7 @@ class Puppet::Node::Exec < Puppet::Indirector::Exec def create_node(name, result) node = Puppet::Node.new(name) set = false - [:parameters, :classes].each do |param| + [:parameters, :classes, :environment].each do |param| if value = result[param] node.send(param.to_s + "=", value) set = true diff --git a/spec/unit/indirector/node/exec.rb b/spec/unit/indirector/node/exec.rb index 744a32b0a..5e6a9b1da 100755 --- a/spec/unit/indirector/node/exec.rb +++ b/spec/unit/indirector/node/exec.rb @@ -59,4 +59,10 @@ describe Puppet::Node::Exec, " when handling the results of the command" do @node.expects(:fact_merge) @searcher.find(@name) end + + it "should set the node's environment if one is provided" do + @result[:environment] = "yay" + @node.expects(:environment=).with "yay" + @searcher.find(@name) + end end |
