Skip to content

Commit

Permalink
remove legacy fact syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
zilchms committed Feb 13, 2024
1 parent 7c4e143 commit 92f4b44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
--fail-on-warnings
--no-parameter_documentation-check
--no-parameter_types-check
--no-legacy_facts-check
10 changes: 5 additions & 5 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
context "on #{os}" do
let(:facts) { facts }

case facts[:osfamily]
case facts[:os]['family']
when 'Debian'
config_file = '/etc/monit/monitrc'
config_dir = '/etc/monit/conf.d'
Expand All @@ -17,7 +17,7 @@
config_dir = '/etc/monit.d'
service_hasstatus = true
monit_version = '5'
config_file = case facts[:operatingsystem]
config_file = case facts[:os]['name']
when 'Amazon'
'/etc/monit.conf'
else
Expand Down Expand Up @@ -64,14 +64,14 @@
end

monit_config_fixture = if monit_version == '4'
File.read(fixtures("monitrc.4.#{facts[:osfamily]}"))
File.read(fixtures("monitrc.4.#{facts[:os]['family']}"))
else
File.read(fixtures("monitrc.#{facts[:osfamily]}"))
File.read(fixtures("monitrc.#{facts[:os]['family']}"))
end

it { is_expected.to contain_file('monit_config').with_content(monit_config_fixture) }

if facts[:osfamily] == 'Debian'
if facts[:os]['family'] == 'Debian'
it do
is_expected.to contain_file('/etc/default/monit').with('notify' => 'Service[monit]').
with_content(%r{^#{default_file_content}$})
Expand Down

0 comments on commit 92f4b44

Please sign in to comment.