Skip to content

(CAT-1435) Address outdated code #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -239,11 +239,11 @@ class foo() {
end
end

context 'support the use of facts and trusted facts for Puppet 3.5 onwards' do
context 'support the use of facts and trusted facts' do
let(:code) do
<<-END
class foo() {
if $facts['osfamily'] == 'redhat' or $trusted['osfamily'] == 'redhat' {
if $facts['os']['family'] == 'redhat' or $trusted['os']['family'] == 'redhat' {
$redhat = true
}
}
Original file line number Diff line number Diff line change
@@ -477,7 +477,7 @@ class { 'some_class':
context 'where the top level of the block has no parameters' do
let(:code) do
<<-END
case $::osfamily {
case $facts['os']['family'] {
'RedHat': {
$datadir = $::operatingsystem ? {
'Amazon' => pick($datadir, 'value'),
64 changes: 32 additions & 32 deletions spec/unit/puppet-lint/plugins/legacy_facts/legacy_facts_spec.rb
Original file line number Diff line number Diff line change
@@ -29,79 +29,79 @@
context "fact variable using legacy $facts['osfamily']" do
let(:code) { "$facts['osfamily']" }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end
end

context 'fact variable using legacy $::osfamily' do
let(:code) { '$::osfamily' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end
end

context 'fact variable using legacy $::blockdevice_sda_model' do
let(:code) { '$::blockdevice_sda_model' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end
end

context "fact variable using legacy $facts['ipaddress6_em2']" do
let(:code) { "$facts['ipaddress6_em2']" }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end
end

context 'fact variable using legacy $::zone_foobar_uuid' do
let(:code) { '$::zone_foobar_uuid' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end
end

context 'fact variable using legacy $::processor314' do
let(:code) { '$::processor314' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end
end

context 'fact variable using legacy $::sp_l3_cache' do
let(:code) { '$::sp_l3_cache' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end
end

context 'fact variable using legacy $::sshrsakey' do
let(:code) { '$::sshrsakey' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end
end

context 'fact variable in interpolated string "${::osfamily}"' do
let(:code) { '"start ${::osfamily} end"' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end
end

context 'fact variable using legacy variable in double quotes "$::osfamily"' do
let(:code) { '"$::osfamily"' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end
end
@@ -168,7 +168,7 @@
let(:code) { "$facts['osfamily']" }
let(:msg) { "legacy fact 'osfamily'" }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -210,7 +210,7 @@
let(:code) { '$::osfamily' }
let(:msg) { "legacy fact 'osfamily'" }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -227,7 +227,7 @@
let(:code) { '$::sshrsakey' }
let(:msg) { "legacy fact 'sshrsakey'" }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -243,7 +243,7 @@
context 'fact variable using legacy $::memoryfree_mb' do
let(:code) { '$::memoryfree_mb' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -255,7 +255,7 @@
context 'fact variable using legacy $::blockdevice_sda_model' do
let(:code) { '$::blockdevice_sda_model' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -267,7 +267,7 @@
context "fact variable using legacy $facts['ipaddress6_em2']" do
let(:code) { "$facts['ipaddress6_em2']" }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -279,7 +279,7 @@
context 'fact variable using legacy $::zone_foobar_uuid' do
let(:code) { '$::zone_foobar_uuid' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -291,7 +291,7 @@
context 'fact variable using legacy $::processor314' do
let(:code) { '$::processor314' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -303,7 +303,7 @@
context 'fact variable using legacy $::sp_l3_cache' do
let(:code) { '$::sp_l3_cache' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -315,7 +315,7 @@
context 'fact variable using legacy $::sshrsakey' do
let(:code) { '$::sshrsakey' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -327,7 +327,7 @@
context 'fact variable in interpolated string "${::osfamily}"' do
let(:code) { '"start ${::osfamily} end"' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -339,7 +339,7 @@
context 'fact variable using legacy variable in double quotes "$::osfamily"' do
let(:code) { '"$::osfamily"' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -351,7 +351,7 @@
context 'fact variable using legacy variable in double quotes "$::gid"' do
let(:code) { '"$::gid"' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -363,7 +363,7 @@
context 'fact variable using legacy variable in double quotes "$::id"' do
let(:code) { '"$::id"' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -375,7 +375,7 @@
context 'fact variable using legacy variable in double quotes "$::lsbdistcodename"' do
let(:code) { '"$::lsbdistcodename"' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -387,7 +387,7 @@
context 'fact variable using legacy variable in double quotes "$::lsbdistdescription"' do
let(:code) { '"$::lsbdistdescription"' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -399,7 +399,7 @@
context 'fact variable using legacy variable in double quotes "$::lsbdistid"' do
let(:code) { '"$::lsbdistid"' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -411,7 +411,7 @@
context 'fact variable using legacy variable in double quotes "$::lsbdistrelease"' do
let(:code) { '"$::lsbdistrelease"' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -423,7 +423,7 @@
context 'fact variable using legacy variable in double quotes "$::lsbmajdistrelease"' do
let(:code) { '"$::lsbmajdistrelease"' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -435,7 +435,7 @@
context 'fact variable using legacy variable in double quotes "$::lsbminordistrelease"' do
let(:code) { '"$::lsbminordistrelease"' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -447,7 +447,7 @@
context 'fact variable using legacy variable in double quotes "$::lsbrelease"' do
let(:code) { '"$::lsbrelease"' }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end

@@ -459,7 +459,7 @@
context "fact variable using facts hash in double quotes \"$facts['lsbrelease']\"" do
let(:code) { "\"${facts['lsbrelease']}\"" }

it 'onlies detect a single problem' do
it 'only detect a single problem' do
expect(problems.size).to eq(1)
end