[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5
Jacob Helwig
jacob at puppetlabs.com
Tue May 10 08:19:21 UTC 2011
The following commit has been merged in the experimental branch:
commit 5569fad994978224dd24df9974ed731a409d11de
Author: Jacob Helwig <jacob at puppetlabs.com>
Date: Tue May 3 14:53:03 2011 -0700
(#7117) Return the environment as a Puppet::Node::Environment in uri2indirection
The environment returned by uri2indirection used to be a
Puppet::Node::Environment. When this changed to simply being the
string of the environment name, this broke assumptions made in other
areas of the code.
Paired-with: Nick Lewis <nick at puppetlabs.com>
diff --git a/lib/puppet/network/http/api/v1.rb b/lib/puppet/network/http/api/v1.rb
index 61307f0..388d549 100644
--- a/lib/puppet/network/http/api/v1.rb
+++ b/lib/puppet/network/http/api/v1.rb
@@ -30,7 +30,7 @@ module Puppet::Network::HTTP::API::V1
method = indirection_method(http_method, indirection)
- params[:environment] = environment
+ params[:environment] = Puppet::Node::Environment.new(environment)
raise ArgumentError, "No request key specified in #{uri}" if key == "" or key.nil?
diff --git a/spec/unit/network/http/api/v1_spec.rb b/spec/unit/network/http/api/v1_spec.rb
index bd95071..a952f24 100755
--- a/spec/unit/network/http/api/v1_spec.rb
+++ b/spec/unit/network/http/api/v1_spec.rb
@@ -31,7 +31,7 @@ describe Puppet::Network::HTTP::API::V1 do
end
it "should use the first field of the URI as the environment" do
- @tester.uri2indirection("GET", "/env/foo/bar", {})[3][:environment].should == "env"
+ @tester.uri2indirection("GET", "/env/foo/bar", {})[3][:environment].to_s.should == "env"
end
it "should fail if the environment is not alphanumeric" do
@@ -39,7 +39,11 @@ describe Puppet::Network::HTTP::API::V1 do
end
it "should use the environment from the URI even if one is specified in the parameters" do
- @tester.uri2indirection("GET", "/env/foo/bar", {:environment => "otherenv"})[3][:environment].should == "env"
+ @tester.uri2indirection("GET", "/env/foo/bar", {:environment => "otherenv"})[3][:environment].to_s.should == "env"
+ end
+
+ it "should return the environment as a Puppet::Node::Environment" do
+ @tester.uri2indirection("GET", "/env/foo/bar", {})[3][:environment].should be_a Puppet::Node::Environment
end
it "should use the second field of the URI as the indirection name" do
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list