puppet 6.7.0-universal-darwin → 6.7.2-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 +4 -4
- data/Gemfile.lock +3 -3
- data/lib/puppet/transaction/report.rb +2 -2
- data/lib/puppet/type.rb +1 -2
- data/lib/puppet/type/exec.rb +1 -1
- data/lib/puppet/util/fileparsing.rb +10 -10
- data/lib/puppet/version.rb +1 -1
- data/spec/fixtures/unit/provider/parsedfile/aliases.txt +2 -0
- data/spec/unit/provider/parsedfile_spec.rb +26 -0
- data/spec/unit/type_spec.rb +18 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e37f78bdb2bb4c71f4302ae7a4868fb892e48cacaae5550d362ff7bbc5d2e2d5
|
4
|
+
data.tar.gz: e26741edd0ed42842461e2045de4d4b0d86681d87fa7d1788e17033fd41b22ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad6b08a5e46c208230ff970289ba60ecc14d353c350d5665b7c3313d6d5d89f9a4a70e6394345ee76e3d741ca1ca973a81a88ed38644208a31b95a4f6026c195
|
7
|
+
data.tar.gz: a3cc0b4a465313780d9a70f7b8bf1c42048cd974e7914c976dace9b999295446e91d18896e9b904223dd3daec6c4c94b064d7ec1629d07734858ed291e666fcb
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
puppet (6.7.
|
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.
|
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.
|
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
|
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
|
|
data/lib/puppet/type/exec.rb
CHANGED
@@ -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
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
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
|
data/lib/puppet/version.rb
CHANGED
@@ -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
|
data/spec/unit/type_spec.rb
CHANGED
@@ -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.
|
4
|
+
version: 6.7.2
|
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: 2019-07-
|
11
|
+
date: 2019-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facter
|
@@ -1710,6 +1710,7 @@ files:
|
|
1710
1710
|
- spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt
|
1711
1711
|
- spec/fixtures/unit/provider/package/zypper/zypper-list-updates-SLES11sp1.out
|
1712
1712
|
- spec/fixtures/unit/provider/package/zypper/zypper-list-updates-empty.out
|
1713
|
+
- spec/fixtures/unit/provider/parsedfile/aliases.txt
|
1713
1714
|
- spec/fixtures/unit/provider/parsedfile/simple.txt
|
1714
1715
|
- spec/fixtures/unit/provider/service/base/ps_ef.mixed_encoding
|
1715
1716
|
- spec/fixtures/unit/provider/service/gentoo/rc_update_show
|
@@ -2953,6 +2954,7 @@ test_files:
|
|
2953
2954
|
- spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt
|
2954
2955
|
- spec/fixtures/unit/provider/package/zypper/zypper-list-updates-SLES11sp1.out
|
2955
2956
|
- spec/fixtures/unit/provider/package/zypper/zypper-list-updates-empty.out
|
2957
|
+
- spec/fixtures/unit/provider/parsedfile/aliases.txt
|
2956
2958
|
- spec/fixtures/unit/provider/parsedfile/simple.txt
|
2957
2959
|
- spec/fixtures/unit/provider/service/base/ps_ef.mixed_encoding
|
2958
2960
|
- spec/fixtures/unit/provider/service/gentoo/rc_update_show
|