puppet 6.19.0-universal-darwin → 6.19.1-universal-darwin

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: f5a134fac2bc645fb5bbdb96026be76b187c62fc0599aab476de897f4aad6308
4
- data.tar.gz: 21cbaf340690bd0f0e72c57eead80347efdd5e889a86b8aed93ecb60b16b895a
3
+ metadata.gz: dce347f60f813e5556eb2fa9dcf48e0b1314f18b303005d5039bc1df0b630993
4
+ data.tar.gz: 80372bb961be69ed3a2a0edb5b227da7194e9f900ffd034a5b32651701d74dfc
5
5
  SHA512:
6
- metadata.gz: fe0ab3e665b59e286c809100af96e0669581935b0a44031e75c1af274d763a3015b4568ecd2cb5c611bc1c251cc09110918417c3806d8ae0d12866afabdfd48a
7
- data.tar.gz: 62af40dfb9713ad1ba360b88e6a3d7f4ee3b992c74a651a131af17c4ef31945e6dec3e1c642171007eadbdd0b96968b5d22d12fba0525a85591db037ccaffa65
6
+ metadata.gz: d99cac625c078eff2e4cf115ab6bf3ecde8673610b469cca33ce99d29b2b73b8d6633ca093ac5d50ddd2792cd9fca241093c5c334eb5f7e49d79d002a6089c98
7
+ data.tar.gz: c53042591c0b50d03b42605cbf98da495b5b86fdae73c8d7ed0abbf9faedf5476a57e55bdea57948bc57c1a3b75251315c055a5a022f7190951a13692ebfe2cd
@@ -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: universal-darwin
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