puppet-lint-legacy_facts-check 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd3cb8032b34bedd7b911d90349ee7e0b921e09c72759da6333830975d060f6f
4
- data.tar.gz: 6ab5ba872068cb338625ea655bb696d5f9d3d46599dfc7260f35aa745a2c0e40
3
+ metadata.gz: 5dd36569f910c1f7a9907a666afb2d6cdd2e516881027e2d84d9ee260e670d10
4
+ data.tar.gz: d67750794d8a7900a03423a9c745e54318e1e102a83cefe34033c2ed77ff821f
5
5
  SHA512:
6
- metadata.gz: 357229fe8dd7417ebc38053ec7eeb174cefac881651dff55d47be03af62f04c6f936059f98499cf33cc9eb7e314c31d842b61b308b263322b3c89ae8dd04cbe8
7
- data.tar.gz: 459f5115df04d1f6c682076a82ad8e3377d7786fb85b301f57d72baee2052ced015dfbf704b24477da6e6e875577124650137bfea40a14ed125d68843843266a
6
+ metadata.gz: 74733b16e7a684abd387334abe0bed9a4ba7f93dda808d32ff3a1f52b86c20e015b67538b2ee5873fbbd550ea71feb2c8179d6079ba4ddf1d72a65c1c7e364b0
7
+ data.tar.gz: df5f3ab48fafb0904ffaa033db415430abecc8aecb3e7027311a6389186930d19fabc05272458a91aa8e16a2f13e290540c73b0793b1e30ea5016180e9f2b715
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  [![Build Status](https://travis-ci.org/mmckinst/puppet-lint-legacy_facts-check.svg?branch=master)](https://travis-ci.org/mmckinst/puppet-lint-legacy_facts-check)
2
- [![Gem](https://img.shields.io/gem/v/puppet-lint-legacy_facts-check.svg?maxAge=2592000)](https://rubygems.org/gems/puppet-lint-legacy_facts-check)
3
- ![](https://img.shields.io/gem/dtv/puppet-lint-legacy_facts-check.svg?style=flat)
4
- ![](https://img.shields.io/gem/dt/puppet-lint-legacy_facts-check.svg?style=flat)
2
+ [![Gem](https://img.shields.io/gem/v/puppet-lint-legacy_facts-check.svg)](https://rubygems.org/gems/puppet-lint-legacy_facts-check)
3
+ [![Total Downloads](https://img.shields.io/gem/dt/puppet-lint-legacy_facts-check.svg)](https://rubygems.org/gems/puppet-lint-legacy_facts-check)
4
+ [![Latest Downloads](https://img.shields.io/gem/dtv/puppet-lint-legacy_facts-check.svg)](https://rubygems.org/gems/puppet-lint-legacy_facts-check)
5
5
 
6
6
  ## Overview
7
7
 
@@ -40,20 +40,20 @@ PuppetLint.new_check(:legacy_facts) do
40
40
  'chassistype' => "facts['dmi']['chassis']['type']",
41
41
  'domain' => "facts['networking']['domain']",
42
42
  'fqdn' => "facts['networking']['fqdn']",
43
- 'gid' => "facts['identity']['gid']",
43
+ 'gid' => "facts['identity']['group']",
44
44
  'hardwareisa' => "facts['processors']['isa']",
45
45
  'hardwaremodel' => "facts['os']['hardware']",
46
46
  'hostname' => "facts['networking']['hostname']",
47
- 'id' => "facts['identity']['uid']",
47
+ 'id' => "facts['identity']['user']",
48
48
  'ipaddress' => "facts['networking']['ip']",
49
49
  'ipaddress6' => "facts['networking']['ip6']",
50
- 'lsbdistcodename' => "facts['distro']['codename']",
51
- 'lsbdistdescription' => "facts['distro']['description']",
52
- 'lsbdistid' => "facts['distro']['id']",
53
- 'lsbdistrelease' => "facts['distro']['release']['full']",
54
- 'lsbmajdistrelease' => "facts['distro']['release']['major']",
55
- 'lsbminordistrelease' => "facts['distro']['release']['minor']",
56
- 'lsbrelease' => "facts['distro']['release']['specification']",
50
+ 'lsbdistcodename' => "facts['os']['distro']['codename']",
51
+ 'lsbdistdescription' => "facts['os']['distro']['description']",
52
+ 'lsbdistid' => "facts['os']['distro']['id']",
53
+ 'lsbdistrelease' => "facts['os']['distro']['release']['full']",
54
+ 'lsbmajdistrelease' => "facts['os']['distro']['release']['major']",
55
+ 'lsbminordistrelease' => "facts['os']['distro']['release']['minor']",
56
+ 'lsbrelease' => "facts['os']['distro']['release']['specification']",
57
57
  'macaddress' => "facts['networking']['mac']",
58
58
  'macosx_buildversion' => "facts['os']['build']",
59
59
  'macosx_productname' => "facts['os']['product']",
@@ -292,5 +292,104 @@ describe 'legacy_facts' do
292
292
  expect(manifest).to eq("\"$facts['os']['family']\"")
293
293
  end
294
294
  end
295
+ context "fact variable using legacy variable in double quotes \"$::gid\"" do
296
+ let(:code) { "\"$::gid\"" }
297
+
298
+ it 'should only detect a single problem' do
299
+ expect(problems).to have(1).problem
300
+ end
301
+
302
+ it 'should use the facts hash' do
303
+ expect(manifest).to eq("\"$facts['identity']['group']\"")
304
+ end
305
+ end
306
+ context "fact variable using legacy variable in double quotes \"$::id\"" do
307
+ let(:code) { "\"$::id\"" }
308
+
309
+ it 'should only detect a single problem' do
310
+ expect(problems).to have(1).problem
311
+ end
312
+
313
+ it 'should use the facts hash' do
314
+ expect(manifest).to eq("\"$facts['identity']['user']\"")
315
+ end
316
+ end
317
+ context "fact variable using legacy variable in double quotes \"$::lsbdistcodename\"" do
318
+ let(:code) { "\"$::lsbdistcodename\"" }
319
+
320
+ it 'should only detect a single problem' do
321
+ expect(problems).to have(1).problem
322
+ end
323
+
324
+ it 'should use the facts hash' do
325
+ expect(manifest).to eq("\"$facts['os']['distro']['codename']\"")
326
+ end
327
+ end
328
+ context "fact variable using legacy variable in double quotes \"$::lsbdistdescription\"" do
329
+ let(:code) { "\"$::lsbdistdescription\"" }
330
+
331
+ it 'should only detect a single problem' do
332
+ expect(problems).to have(1).problem
333
+ end
334
+
335
+ it 'should use the facts hash' do
336
+ expect(manifest).to eq("\"$facts['os']['distro']['description']\"")
337
+ end
338
+ end
339
+ context "fact variable using legacy variable in double quotes \"$::lsbdistid\"" do
340
+ let(:code) { "\"$::lsbdistid\"" }
341
+
342
+ it 'should only detect a single problem' do
343
+ expect(problems).to have(1).problem
344
+ end
345
+
346
+ it 'should use the facts hash' do
347
+ expect(manifest).to eq("\"$facts['os']['distro']['id']\"")
348
+ end
349
+ end
350
+ context "fact variable using legacy variable in double quotes \"$::lsbdistrelease\"" do
351
+ let(:code) { "\"$::lsbdistrelease\"" }
352
+
353
+ it 'should only detect a single problem' do
354
+ expect(problems).to have(1).problem
355
+ end
356
+
357
+ it 'should use the facts hash' do
358
+ expect(manifest).to eq("\"$facts['os']['distro']['release']['full']\"")
359
+ end
360
+ end
361
+ context "fact variable using legacy variable in double quotes \"$::lsbmajdistrelease\"" do
362
+ let(:code) { "\"$::lsbmajdistrelease\"" }
363
+
364
+ it 'should only detect a single problem' do
365
+ expect(problems).to have(1).problem
366
+ end
367
+
368
+ it 'should use the facts hash' do
369
+ expect(manifest).to eq("\"$facts['os']['distro']['release']['major']\"")
370
+ end
371
+ end
372
+ context "fact variable using legacy variable in double quotes \"$::lsbminordistrelease\"" do
373
+ let(:code) { "\"$::lsbminordistrelease\"" }
374
+
375
+ it 'should only detect a single problem' do
376
+ expect(problems).to have(1).problem
377
+ end
378
+
379
+ it 'should use the facts hash' do
380
+ expect(manifest).to eq("\"$facts['os']['distro']['release']['minor']\"")
381
+ end
382
+ end
383
+ context "fact variable using legacy variable in double quotes \"$::lsbrelease\"" do
384
+ let(:code) { "\"$::lsbrelease\"" }
385
+
386
+ it 'should only detect a single problem' do
387
+ expect(problems).to have(1).problem
388
+ end
389
+
390
+ it 'should use the facts hash' do
391
+ expect(manifest).to eq("\"$facts['os']['distro']['release']['specification']\"")
392
+ end
393
+ end
295
394
  end
296
395
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint-legacy_facts-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark McKinstry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-13 00:00:00.000000000 Z
11
+ date: 2019-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet-lint