puppet 6.7.0 → 6.7.2

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: 6739b00b930cc1e7e8f361e958769b3c3f02ab6ee88e96bdf018a98b847cfb09
4
- data.tar.gz: 5b7812551d0fb9dcfc0c2793b5cb3ef36997efde0c878567b09f520808e41bd2
3
+ metadata.gz: 5d3d59e208683953e4535c887504a78de65dfb0db03f7624a98dc5701b600000
4
+ data.tar.gz: c2b552ea7c474edf40c19a84a6d03b6590278af5ee606a823d44e17acca27ebd
5
5
  SHA512:
6
- metadata.gz: 526dcbc10b75e92ca4028824567e2e83bb2c80938be0796e6574b0cb5efffb8dc1ad235763aa41e75946315c218aafd771d388e5cadeaaffae51cb338325eb6f
7
- data.tar.gz: c800fbda4bfae645c209742ff25ed10ef07368da5920b241c81f6c6bcd54e4b113e32c08aa52be4a717b22da77cd6ab6e0ffeef5d5620abd9f83426d69bb6d3f
6
+ metadata.gz: 37fb316f8507f6f8c3f58ea63daa55a24e34b7dcbf9a2e7ba9261d28e4cd653b61fdad67ae99277402c8b05edeba6240f6cbcdfde5fc3e6560b461203052c2d9
7
+ data.tar.gz: b0f55d9966b43f82ab4bc32ae5c377a9edecf9253d031fab005da79e336b2537b22d999bc709276a7db9d03265db7c68b6ff433d609b004e670b3406af13ffe6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- puppet (6.7.0)
4
+ puppet (6.7.2)
5
5
  CFPropertyList (~> 2.2)
6
6
  facter (>= 2.4.0, < 4)
7
7
  fast_gettext (~> 1.1)
@@ -62,14 +62,14 @@ GEM
62
62
  coderay (~> 1.1.0)
63
63
  method_source (~> 0.9.0)
64
64
  public_suffix (3.1.1)
65
- puppet-resource_api (1.8.4)
65
+ puppet-resource_api (1.8.6)
66
66
  hocon (>= 1.0)
67
67
  puppetserver-ca (1.3.2)
68
68
  facter (>= 2.0.1, < 4)
69
69
  racc (1.4.9)
70
70
  rainbow (2.2.2)
71
71
  rake
72
- rake (12.3.2)
72
+ rake (12.3.3)
73
73
  rdiscount (2.2.0.1)
74
74
  rdoc (6.1.1)
75
75
  ronn (0.7.3)
@@ -256,11 +256,11 @@ class Puppet::Transaction::Report
256
256
  @time = data['time']
257
257
  @corrective_change = data['corrective_change']
258
258
 
259
- if data['master_used']
259
+ if data['master_used']
260
260
  @master_used = data['master_used']
261
261
  end
262
262
 
263
- if data['catalog_uuid']
263
+ if data['catalog_uuid']
264
264
  @catalog_uuid = data['catalog_uuid']
265
265
  end
266
266
 
data/lib/puppet/type.rb CHANGED
@@ -2187,7 +2187,7 @@ end
2187
2187
  # Retrieve the list of names from the block.
2188
2188
  list = self.instance_eval(&block)
2189
2189
  next unless list
2190
- list = Array(list)
2190
+ list = [list] unless list.is_a?(Array)
2191
2191
 
2192
2192
  # Collect the current prereqs
2193
2193
  list.each { |dep|
@@ -2207,7 +2207,6 @@ end
2207
2207
  end
2208
2208
  }
2209
2209
  }
2210
-
2211
2210
  reqs
2212
2211
  end
2213
2212
 
@@ -573,7 +573,7 @@ module Puppet
573
573
  autorequire(:user) do
574
574
  # Autorequire users if they are specified by name
575
575
  user = self[:user]
576
- if user !~ /^\d+$/
576
+ if user && user !~ /^\d+$/
577
577
  user
578
578
  end
579
579
  end
@@ -201,7 +201,7 @@ module Puppet::Util::FileParsing
201
201
  else
202
202
  ret = {}
203
203
  sep = record.separator
204
-
204
+
205
205
  # String "helpfully" replaces ' ' with /\s+/ in splitting, so we
206
206
  # have to work around it.
207
207
  if sep == " "
@@ -216,20 +216,20 @@ module Puppet::Util::FileParsing
216
216
  ret[param] = :absent
217
217
  end
218
218
  end
219
-
219
+
220
220
  if record.rollup and ! line_fields.empty?
221
221
  last_field = record.fields[-1]
222
222
  val = ([ret[last_field]] + line_fields).join(record.joiner)
223
223
  ret[last_field] = val
224
224
  end
225
225
  end
226
-
227
- if ret
228
- ret[:record_type] = record.name
229
- return ret
230
- else
231
- return nil
232
- end
226
+ end
227
+
228
+ if ret
229
+ ret[:record_type] = record.name
230
+ return ret
231
+ else
232
+ return nil
233
233
  end
234
234
  end
235
235
 
@@ -373,7 +373,7 @@ module Puppet::Util::FileParsing
373
373
 
374
374
  def valid_attr?(type, attr)
375
375
  type = type.intern
376
- record = record_type(type)
376
+ record = record_type(type)
377
377
  if record && record.fields.include?(attr.intern)
378
378
  return true
379
379
  else
@@ -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.7.0'
9
+ PUPPETVERSION = '6.7.2'
10
10
 
11
11
  ##
12
12
  # version is a public API method intended to always provide a fast and
@@ -0,0 +1,2 @@
1
+ manager: root
2
+ dumper: postmaster
@@ -224,4 +224,30 @@ describe "A very basic provider based on ParsedFile" do
224
224
  end
225
225
  end
226
226
  end
227
+
228
+ context 'parsing a record type' do
229
+ let(:input_text) { File.read(my_fixture('aliases.txt')) }
230
+ let(:target) { tmpfile('parsedfile_spec') }
231
+ let(:provider) do
232
+ example_provider_class = Class.new(Puppet::Provider::ParsedFile)
233
+ example_provider_class.default_target = target
234
+ # Setup some record rules
235
+ example_provider_class.instance_eval do
236
+ record_line :aliases, :fields => %w{manager alias}, :separator => ':'
237
+ end
238
+ example_provider_class.initvars
239
+ example_provider_class.prefetch
240
+ example_provider_class
241
+ end
242
+ let(:expected_result) do
243
+ [
244
+ {:manager=>"manager", :alias=>" root", :record_type=>:aliases},
245
+ {:manager=>"dumper", :alias=>" postmaster", :record_type=>:aliases}
246
+ ]
247
+ end
248
+
249
+ subject { provider.parse(input_text) }
250
+
251
+ it { is_expected.to match_array(expected_result) }
252
+ end
227
253
  end
@@ -408,6 +408,24 @@ describe Puppet::Type, :unless => Puppet::Util::Platform.windows? do
408
408
  end
409
409
 
410
410
  describe "when building autorelations" do
411
+ it "should be able to autorequire puppet resources" do
412
+ Puppet::Type.newtype(:autorelation_two) do
413
+ newparam(:name) { isnamevar }
414
+ autorequire(:autorelation_one) { Puppet::Type.type(:notify).new(name: 'test') }
415
+ end
416
+
417
+ relationship_graph = compile_to_relationship_graph(<<-MANIFEST)
418
+ autorelation_one { 'Notify[test]': }
419
+ autorelation_two { 'bar': }
420
+ MANIFEST
421
+
422
+ src = relationship_graph.vertices.select{ |x| x.ref.to_s == 'Notify[test]' }.first
423
+ dst = relationship_graph.vertices.select{ |x| x.ref.to_s == 'Autorelation_two[bar]' }.first
424
+
425
+ expect(relationship_graph.edge?(src,dst)).to be_truthy
426
+ expect(relationship_graph.edges_between(src,dst).first.event).to eq(:NONE)
427
+ end
428
+
411
429
  it "should be able to autorequire resources" do
412
430
  Puppet::Type.newtype(:autorelation_two) do
413
431
  newparam(:name) { isnamevar }
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.7.0
4
+ version: 6.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-19 00:00:00.000000000 Z
11
+ date: 2019-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facter
@@ -1696,6 +1696,7 @@ files:
1696
1696
  - spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt
1697
1697
  - spec/fixtures/unit/provider/package/zypper/zypper-list-updates-SLES11sp1.out
1698
1698
  - spec/fixtures/unit/provider/package/zypper/zypper-list-updates-empty.out
1699
+ - spec/fixtures/unit/provider/parsedfile/aliases.txt
1699
1700
  - spec/fixtures/unit/provider/parsedfile/simple.txt
1700
1701
  - spec/fixtures/unit/provider/service/base/ps_ef.mixed_encoding
1701
1702
  - spec/fixtures/unit/provider/service/gentoo/rc_update_show
@@ -2939,6 +2940,7 @@ test_files:
2939
2940
  - spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt
2940
2941
  - spec/fixtures/unit/provider/package/zypper/zypper-list-updates-SLES11sp1.out
2941
2942
  - spec/fixtures/unit/provider/package/zypper/zypper-list-updates-empty.out
2943
+ - spec/fixtures/unit/provider/parsedfile/aliases.txt
2942
2944
  - spec/fixtures/unit/provider/parsedfile/simple.txt
2943
2945
  - spec/fixtures/unit/provider/service/base/ps_ef.mixed_encoding
2944
2946
  - spec/fixtures/unit/provider/service/gentoo/rc_update_show