puppet 5.2.0 → 5.3.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puppet might be problematic. Click here for more details.

Files changed (40) hide show
  1. data/Gemfile +9 -28
  2. data/lib/puppet.rb +1 -0
  3. data/lib/puppet/defaults.rb +21 -5
  4. data/lib/puppet/indirector/certificate_revocation_list/rest.rb +12 -0
  5. data/lib/puppet/network/http/connection.rb +108 -15
  6. data/lib/puppet/parser/compiler.rb +1 -1
  7. data/lib/puppet/pops/loader/puppet_resource_type_impl_instantiator.rb +1 -1
  8. data/lib/puppet/pops/lookup/hiera_config.rb +1 -1
  9. data/lib/puppet/pops/parser/egrammar.ra +1 -1
  10. data/lib/puppet/pops/parser/eparser.rb +378 -378
  11. data/lib/puppet/pops/parser/heredoc_support.rb +1 -1
  12. data/lib/puppet/pops/patterns.rb +2 -1
  13. data/lib/puppet/pops/types/p_object_type.rb +2 -0
  14. data/lib/puppet/pops/types/puppet_object.rb +1 -1
  15. data/lib/puppet/pops/types/ruby_generator.rb +1 -1
  16. data/lib/puppet/pops/types/type_calculator.rb +1 -0
  17. data/lib/puppet/settings.rb +3 -1
  18. data/lib/puppet/settings/certificate_revocation_setting.rb +21 -0
  19. data/lib/puppet/ssl/certificate_authority.rb +1 -1
  20. data/lib/puppet/ssl/certificate_revocation_list.rb +1 -1
  21. data/lib/puppet/ssl/host.rb +29 -16
  22. data/lib/puppet/transaction/report.rb +9 -3
  23. data/lib/puppet/type/scheduled_task.rb +4 -5
  24. data/lib/puppet/vendor/pathspec/lib/pathspec.rb +1 -1
  25. data/lib/puppet/version.rb +1 -1
  26. data/locales/ja/puppet.po +63 -57
  27. data/locales/puppet.pot +46 -32
  28. data/spec/unit/functions/epp_spec.rb +7 -2
  29. data/spec/unit/functions4_spec.rb +3 -2
  30. data/spec/unit/indirector/certificate_revocation_list/rest_spec.rb +8 -0
  31. data/spec/unit/network/http/connection_spec.rb +88 -1
  32. data/spec/unit/pops/parser/lexer2_spec.rb +30 -0
  33. data/spec/unit/pops/parser/parse_basic_expressions_spec.rb +30 -0
  34. data/spec/unit/pops/types/p_object_type_spec.rb +10 -2
  35. data/spec/unit/pops/types/type_calculator_spec.rb +13 -0
  36. data/spec/unit/pops/validator/validator_spec.rb +10 -0
  37. data/spec/unit/settings/certificate_revocation_setting_spec.rb +37 -0
  38. data/spec/unit/ssl/host_spec.rb +22 -4
  39. data/spec/unit/transaction/report_spec.rb +5 -0
  40. metadata +5 -2
@@ -574,6 +574,16 @@ describe "validating 4x" do
574
574
  end
575
575
  end
576
576
 
577
+ context 'uses a var pattern that is performant' do
578
+ it 'such that illegal VAR_NAME is not too slow' do
579
+ t = Time.now.nsec
580
+ result = '$hg_oais::archivematica::requirements::automation_tools::USER' =~ Puppet::Pops::Patterns::VAR_NAME
581
+ t2 = Time.now.nsec
582
+ expect(result).to be(nil)
583
+ expect(t2-t).to be < 1000000 # one ms as a check for very slow operation, is in fact at ~< 10 microsecond
584
+ end
585
+ end
586
+
577
587
  def parse(source)
578
588
  Puppet::Pops::Parser::Parser.new.parse_string(source)
579
589
  end
@@ -0,0 +1,37 @@
1
+ require 'spec_helper'
2
+
3
+ require 'puppet/settings'
4
+ require 'puppet/settings/certificate_revocation_setting'
5
+
6
+ describe Puppet::Settings::CertificateRevocationSetting do
7
+ subject { described_class.new(:settings => stub('settings'), :desc => "test") }
8
+
9
+ it "is of type :certificate_revocation" do
10
+ expect(subject.type).to eq :certificate_revocation
11
+ end
12
+
13
+ describe "munging the value" do
14
+ ['true', true, 'chain'].each do |setting|
15
+ it "munges #{setting.inspect} to :chain" do
16
+ expect(subject.munge(setting)).to eq :chain
17
+ end
18
+ end
19
+
20
+ it "munges 'leaf' to :leaf" do
21
+ expect(subject.munge("leaf")).to eq :leaf
22
+ end
23
+
24
+ ['false', false, nil].each do |setting|
25
+ it "munges #{setting.inspect} to false" do
26
+ expect(subject.munge(setting)).to eq false
27
+ end
28
+ end
29
+
30
+ it "raises an error when given an unexpected object type" do
31
+ expect {
32
+ subject.munge(1)
33
+ }.to raise_error(Puppet::Settings::ValidationError, "Invalid certificate revocation value 1: must be one of 'true', 'chain', 'leaf', or 'false'")
34
+ end
35
+ end
36
+ end
37
+
@@ -714,9 +714,27 @@ describe Puppet::SSL::Host do
714
714
  Puppet::SSL::CertificateRevocationList.indirection.stubs(:find).returns @crl
715
715
  end
716
716
 
717
- describe "and 'certificate_revocation' is true" do
717
+ [true, 'chain'].each do |crl_setting|
718
+ describe "and 'certificate_revocation' is #{crl_setting}" do
719
+ before do
720
+ Puppet[:certificate_revocation] = crl_setting
721
+ end
722
+
723
+ it "should add the CRL" do
724
+ @store.expects(:add_crl).with "real_crl"
725
+ @host.ssl_store
726
+ end
727
+
728
+ it "should set the flags to OpenSSL::X509::V_FLAG_CRL_CHECK_ALL|OpenSSL::X509::V_FLAG_CRL_CHECK" do
729
+ @store.expects(:flags=).with(OpenSSL::X509::V_FLAG_CRL_CHECK_ALL|OpenSSL::X509::V_FLAG_CRL_CHECK)
730
+ @host.ssl_store
731
+ end
732
+ end
733
+ end
734
+
735
+ describe "and 'certificate_revocation' is leaf" do
718
736
  before do
719
- Puppet[:certificate_revocation] = true
737
+ Puppet[:certificate_revocation] = 'leaf'
720
738
  end
721
739
 
722
740
  it "should add the CRL" do
@@ -724,8 +742,8 @@ describe Puppet::SSL::Host do
724
742
  @host.ssl_store
725
743
  end
726
744
 
727
- it "should set the flags to OpenSSL::X509::V_FLAG_CRL_CHECK_ALL|OpenSSL::X509::V_FLAG_CRL_CHECK" do
728
- @store.expects(:flags=).with OpenSSL::X509::V_FLAG_CRL_CHECK_ALL|OpenSSL::X509::V_FLAG_CRL_CHECK
745
+ it "should set the flags to OpenSSL::X509::V_FLAG_CRL_CHECK" do
746
+ @store.expects(:flags=).with(OpenSSL::X509::V_FLAG_CRL_CHECK)
729
747
  @host.ssl_store
730
748
  end
731
749
  end
@@ -199,6 +199,11 @@ describe Puppet::Transaction::Report do
199
199
  end
200
200
 
201
201
  describe "when computing exit status" do
202
+ it "should produce -1 if no metrics are present" do
203
+ report = Puppet::Transaction::Report.new("apply")
204
+ expect(report.exit_status).to eq(-1)
205
+ end
206
+
202
207
  it "should produce 2 if changes are present" do
203
208
  report = Puppet::Transaction::Report.new
204
209
  report.add_metric("changes", {"total" => 1})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.0
4
+ version: 5.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-09-12 00:00:00.000000000 Z
12
+ date: 2017-09-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: facter
@@ -701,6 +701,7 @@ files:
701
701
  - lib/puppet/settings/file_or_directory_setting.rb
702
702
  - lib/puppet/settings/duration_setting.rb
703
703
  - lib/puppet/settings/symbolic_enum_setting.rb
704
+ - lib/puppet/settings/certificate_revocation_setting.rb
704
705
  - lib/puppet/settings/environment_conf.rb
705
706
  - lib/puppet/settings/server_list_setting.rb
706
707
  - lib/puppet/settings/ttl_setting.rb
@@ -2260,6 +2261,7 @@ files:
2260
2261
  - spec/unit/settings/environment_conf_spec.rb
2261
2262
  - spec/unit/settings/ini_file_spec.rb
2262
2263
  - spec/unit/settings/priority_setting_spec.rb
2264
+ - spec/unit/settings/certificate_revocation_setting_spec.rb
2263
2265
  - spec/unit/settings/file_setting_spec.rb
2264
2266
  - spec/unit/settings/array_setting_spec.rb
2265
2267
  - spec/unit/settings/duration_setting_spec.rb
@@ -3533,6 +3535,7 @@ test_files:
3533
3535
  - spec/unit/settings/environment_conf_spec.rb
3534
3536
  - spec/unit/settings/ini_file_spec.rb
3535
3537
  - spec/unit/settings/priority_setting_spec.rb
3538
+ - spec/unit/settings/certificate_revocation_setting_spec.rb
3536
3539
  - spec/unit/settings/file_setting_spec.rb
3537
3540
  - spec/unit/settings/array_setting_spec.rb
3538
3541
  - spec/unit/settings/duration_setting_spec.rb