diff options
author | Luke Kanies <luke@madstop.com> | 2008-02-23 19:09:29 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-02-23 19:09:29 -0500 |
commit | 0323986acd3a288e77c54b5fde20b280fa92b90a (patch) | |
tree | 9b12a0bc61c2918beeafbd9fbe685304236c9d62 | |
parent | ff9705914570158d1bad3073728a2e94ca4a0060 (diff) | |
parent | 939c952465815486da0d6c1a2207debb61a45618 (diff) | |
download | puppet-0323986acd3a288e77c54b5fde20b280fa92b90a.tar.gz puppet-0323986acd3a288e77c54b5fde20b280fa92b90a.tar.xz puppet-0323986acd3a288e77c54b5fde20b280fa92b90a.zip |
Merge commit 'turnbull/0.24.x' into 0.24.x
-rw-r--r-- | lib/puppet/network/client/master.rb | 6 | ||||
-rwxr-xr-x | lib/puppet/sslcertificates.rb | 2 | ||||
-rw-r--r-- | lib/puppet/util/tagging.rb | 2 | ||||
-rwxr-xr-x | spec/unit/util/tagging.rb | 4 | ||||
-rwxr-xr-x | test/network/client/master.rb | 18 |
5 files changed, 28 insertions, 4 deletions
diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb index 6d1a0235f..390f3d4e2 100644 --- a/lib/puppet/network/client/master.rb +++ b/lib/puppet/network/client/master.rb @@ -40,8 +40,10 @@ class Puppet::Network::Client::Master < Puppet::Network::Client facts["clientversion"] = Puppet.version.to_s # And add our environment as a fact. - facts["environment"] = Puppet[:environment] - + unless facts.include?("environment") + facts["environment"] = Puppet[:environment] + end + facts end diff --git a/lib/puppet/sslcertificates.rb b/lib/puppet/sslcertificates.rb index bd0ce8c92..0c579d0ad 100755 --- a/lib/puppet/sslcertificates.rb +++ b/lib/puppet/sslcertificates.rb @@ -72,7 +72,7 @@ module Puppet::SSLCertificates subject_alt_name << 'DNS:' + name.sub(/^[^.]+./, "puppet.") # add puppet.domain as an alias end key_usage = %w{digitalSignature keyEncipherment} - ext_key_usage = %w{serverAuth clientAuth} + ext_key_usage = %w{serverAuth clientAuth emailProtection} when :ocsp: basic_constraint = "CA:FALSE" key_usage = %w{nonRepudiation digitalSignature} diff --git a/lib/puppet/util/tagging.rb b/lib/puppet/util/tagging.rb index 9abb3fb2b..8a50f3458 100644 --- a/lib/puppet/util/tagging.rb +++ b/lib/puppet/util/tagging.rb @@ -34,6 +34,6 @@ module Puppet::Util::Tagging private def valid_tag?(tag) - tag =~ /^\w[-\w:]*$/ + tag =~ /^\w[-\w:.]*$/ end end diff --git a/spec/unit/util/tagging.rb b/spec/unit/util/tagging.rb index 91cbb213d..d61ee8ccb 100755 --- a/spec/unit/util/tagging.rb +++ b/spec/unit/util/tagging.rb @@ -61,6 +61,10 @@ describe Puppet::Util::Tagging, "when adding tags" do lambda { @tagger.tag("good_tag") }.should_not raise_error(Puppet::ParseError) end + it "should allow tags containing '.' characters" do + lambda { @tagger.tag("good.tag") }.should_not raise_error(Puppet::ParseError) + end + it "should provide a method for testing tag validity" do @tagger.metaclass.publicize_methods(:valid_tag?) { @tagger.should be_respond_to(:valid_tag?) } end diff --git a/test/network/client/master.rb b/test/network/client/master.rb index 696d08bfd..67c47fa6d 100755 --- a/test/network/client/master.rb +++ b/test/network/client/master.rb @@ -211,6 +211,24 @@ end "Lost value to hostname") end + # Make sure that setting environment by fact takes precedence to configuration + def test_setenvironmentwithfact + name = "environment" + value = "test_environment" + + Puppet[:filetimeout] = -1 + Puppet[:factsource] = tempfile() + Dir.mkdir(Puppet[:factsource]) + file = File.join(Puppet[:factsource], "#{name}.rb") + File.open(file, "w") do |f| + f.puts %{Facter.add("#{name}") do setcode { "#{value}" } end } + end + + Puppet::Network::Client.master.getfacts + + assert_equal(value, Puppet::Network::Client.master.facts[name]) + end + # Make sure we load all facts on startup. def test_loadfacts dirs = [tempfile(), tempfile()] |