puppet 6.19.0 → 6.19.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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8766d9fc7f4fafabae27f429434e3041ac41640ca787b883ec7d959e08456415
4
- data.tar.gz: e17375865d63248f9343b23b643c2d87091b6aa02d07485f4a0432872bb5aa7e
3
+ metadata.gz: 985de1bb38a0e514fd75418ce49b322bcfe4d2cd1944aacf5e68bfc9b5ab148d
4
+ data.tar.gz: cb12244a887c251861a4ece670f880346825f866eec9c827a2f47adfed54d580
5
5
  SHA512:
6
- metadata.gz: 06b9cbf96363c563feef3869acbbe55f518e2ed029242a7d04bf073260bd1b8c376e792270f6d93f8f209e15594fd21b7a39db50c746640babb321e373e460ca
7
- data.tar.gz: ab56f99c330248009362c77702f83ba404fc2b64e233ba40c4cc1e434c0dc941d2e5bcb4e6899786ac080c7d8827eab671b7a811a554a3840d1c1dd20c01cbb2
6
+ metadata.gz: a743b1fa8c5f897a421e346f955004fbc720b894e919694cd05873efeb6c88652e81657277d47f615cf306f6be0026b636fa670c08fd9c9218c538f628569db1
7
+ data.tar.gz: 96df128d7cfa12cd7452f5cfc9822ca9c5c44440210a0d198741ceb2757dba1fe8c3019b84cc1144c43f5659b977fa7cfc3e4d92c5835485e90ec2a190c7cd56
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- puppet (6.19.0)
4
+ puppet (6.19.1)
5
5
  CFPropertyList (~> 2.2)
6
6
  concurrent-ruby (~> 1.0)
7
7
  deep_merge (~> 1.0)
@@ -28,7 +28,7 @@ GEM
28
28
  deep_merge (1.2.1)
29
29
  diff-lcs (1.4.4)
30
30
  docopt (0.6.1)
31
- facter (4.0.43)
31
+ facter (4.0.44)
32
32
  hocon (~> 1.3)
33
33
  thor (>= 1.0.1, < 2.0)
34
34
  fast_gettext (1.1.2)
@@ -385,6 +385,19 @@ class Puppet::Settings
385
385
  call_hooks_deferred_to_application_initialization
386
386
  issue_deprecations
387
387
 
388
+ run_mode = Puppet::Util::RunMode[self.preferred_run_mode]
389
+ if run_mode.agent? || run_mode.server?
390
+ if self.set_in_section?(:masterport, run_mode.name) && !self.set_in_section?(:serverport, run_mode.name)
391
+ self[:serverport] = self[:masterport]
392
+ elsif self.set_by_config?(:masterport) && !self.set_by_config?(:serverport)
393
+ self[:serverport] = self[:masterport]
394
+ elsif self.set_in_section?(:serverport, run_mode.name) && !self.set_in_section?(:masterport, run_mode.name)
395
+ self[:masterport] = self[:serverport]
396
+ elsif self.set_by_config?(:serverport) && !self.set_by_config?(:masterport)
397
+ self[:masterport] = self[:serverport]
398
+ end
399
+ end
400
+
388
401
  REQUIRED_APP_SETTINGS.each do |key|
389
402
  create_ancestors(Puppet[key])
390
403
  end
@@ -916,6 +929,16 @@ class Puppet::Settings
916
929
  end
917
930
  end
918
931
 
932
+ # Allow later inspection to determine if the setting was set by user
933
+ # config, rather than a default setting.
934
+ def set_in_section?(param, section)
935
+ param = param.to_sym
936
+ vals = searchpath_values(SearchPathElement.new(section, :section))
937
+ if vals
938
+ vals.lookup(param)
939
+ end
940
+ end
941
+
919
942
  # Patches the value for a param in a section.
920
943
  # This method is required to support the use case of unifying --dns-alt-names and
921
944
  # --dns_alt_names in the certificate face. Ideally this should be cleaned up.
@@ -6,7 +6,7 @@
6
6
  # Raketasks and such to set the version based on the output of `git describe`
7
7
 
8
8
  module Puppet
9
- PUPPETVERSION = '6.19.0'
9
+ PUPPETVERSION = '6.19.1'
10
10
 
11
11
  ##
12
12
  # version is a public API method intended to always provide a fast and
@@ -897,6 +897,144 @@ describe Puppet::Settings do
897
897
  expect(metadata(@settings.setting(:myfile))).to eq({:mode => "664"})
898
898
  end
899
899
 
900
+ context "when setting serverport and masterport" do
901
+ before(:each) do
902
+ default_values = {}
903
+ PuppetSpec::Settings::TEST_APP_DEFAULT_DEFINITIONS.keys.each do |key|
904
+ default_values[key] = 'default value'
905
+ end
906
+ @settings.define_settings :main, PuppetSpec::Settings::TEST_APP_DEFAULT_DEFINITIONS
907
+ @settings.define_settings :server, :masterport => { :desc => "a", :default => 1000 }
908
+ @settings.define_settings :server, :serverport => { :desc => "a", :default => 1000 }
909
+ @settings.define_settings :server, :ca_port => { :desc => "a", :default => "$serverport" }
910
+ @settings.define_settings :server, :report_port => { :desc => "a", :default => "$serverport" }
911
+ expect(@settings).to receive(:read_file).and_return(text)
912
+ @settings.send(:parse_config_files)
913
+ @settings.initialize_app_defaults(default_values.merge(:run_mode => :agent))
914
+ expect(@settings.preferred_run_mode).to eq(:agent)
915
+ end
916
+
917
+ context 'with serverport in main and masterport in agent' do
918
+ let(:text) do
919
+ "[main]
920
+ serverport = 444
921
+ [agent]
922
+ masterport = 445
923
+ "
924
+ end
925
+
926
+ it { expect(@settings[:serverport]).to eq(445) }
927
+ it { expect(@settings[:ca_port]).to eq("445") }
928
+ it { expect(@settings[:report_port]).to eq("445") }
929
+ end
930
+
931
+ context 'with serverport and masterport in main' do
932
+ let(:text) do
933
+ "[main]
934
+ serverport = 445
935
+ masterport = 444
936
+ "
937
+ end
938
+
939
+ it { expect(@settings[:serverport]).to eq(445) }
940
+ it { expect(@settings[:ca_port]).to eq("445") }
941
+ it { expect(@settings[:report_port]).to eq("445") }
942
+ end
943
+
944
+ context 'with serverport and masterport in agent' do
945
+ let(:text) do
946
+ "[agent]
947
+ serverport = 445
948
+ masterport = 444
949
+ "
950
+ end
951
+
952
+ it { expect(@settings[:serverport]).to eq(445) }
953
+ it { expect(@settings[:ca_port]).to eq("445") }
954
+ it { expect(@settings[:report_port]).to eq("445") }
955
+ end
956
+
957
+ context 'with both serverport and masterport in main and agent' do
958
+ let(:text) do
959
+ "[main]
960
+ serverport = 447
961
+ masterport = 442
962
+ [agent]
963
+ serverport = 445
964
+ masterport = 444
965
+ "
966
+ end
967
+
968
+ it { expect(@settings[:serverport]).to eq(445) }
969
+ it { expect(@settings[:ca_port]).to eq("445") }
970
+ it { expect(@settings[:report_port]).to eq("445") }
971
+ end
972
+
973
+ context 'with serverport in agent and masterport in main' do
974
+ let(:text) do
975
+ "[agent]
976
+ serverport = 444
977
+ [main]
978
+ masterport = 445
979
+ "
980
+ end
981
+
982
+ it { expect(@settings[:serverport]).to eq(444) }
983
+ it { expect(@settings[:ca_port]).to eq("444") }
984
+ it { expect(@settings[:report_port]).to eq("444") }
985
+ end
986
+
987
+ context 'with masterport in main' do
988
+ let(:text) do
989
+ "[main]
990
+ masterport = 445
991
+ "
992
+ end
993
+
994
+ it { expect(@settings[:serverport]).to eq(445) }
995
+ it { expect(@settings[:ca_port]).to eq("445") }
996
+ it { expect(@settings[:report_port]).to eq("445") }
997
+ end
998
+
999
+ context 'with masterport in agent' do
1000
+ let(:text) do
1001
+ "[agent]
1002
+ masterport = 445
1003
+ "
1004
+ end
1005
+
1006
+ it { expect(@settings[:serverport]).to eq(445) }
1007
+ it { expect(@settings[:ca_port]).to eq("445") }
1008
+ it { expect(@settings[:report_port]).to eq("445") }
1009
+ end
1010
+
1011
+ context 'with serverport in agent' do
1012
+ let(:text) do
1013
+ "[agent]
1014
+ serverport = 445
1015
+ "
1016
+ end
1017
+
1018
+ it { expect(@settings[:serverport]).to eq(445) }
1019
+ it { expect(@settings[:masterport]).to eq(445) }
1020
+ it { expect(@settings[:ca_port]).to eq("445") }
1021
+ it { expect(@settings[:report_port]).to eq("445") }
1022
+ end
1023
+
1024
+ context 'with serverport in main' do
1025
+ let(:text) do
1026
+ "[main]
1027
+ serverport = 445
1028
+ "
1029
+ end
1030
+
1031
+ it { expect(@settings[:serverport]).to eq(445) }
1032
+ it { expect(@settings[:masterport]).to eq(445) }
1033
+ it { expect(@settings[:ca_port]).to eq("445") }
1034
+ it { expect(@settings[:report_port]).to eq("445") }
1035
+ end
1036
+ end
1037
+
900
1038
  it "does not use the metadata from the same setting in a different section" do
901
1039
  default_values = {}
902
1040
  PuppetSpec::Settings::TEST_APP_DEFAULT_DEFINITIONS.keys.each do |key|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.19.0
4
+ version: 6.19.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-19 00:00:00.000000000 Z
11
+ date: 2020-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facter