Skip to content

lint fixes - remove legacy facts, remove redundant qualified class inclusion #120

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
$default_user = 'root'
$package_ensure = 'installed'

case $::osfamily {
case $facts['os']['family'] {
'FreeBSD': { $default_group = 'wheel' }
default: { $default_group = 'root' }
}

case $::osfamily {
case $facts['os']['family'] {
'Debian': {
$confdir = '/etc/xinetd.d'
$conffile = '/etc/xinetd.conf'
Expand Down Expand Up @@ -71,7 +71,7 @@
$service_status = undef
}
'Linux': {
case $::operatingsystem {
case $facts['os']['name'] {
'Amazon': {
$confdir = '/etc/xinetd.d'
$conffile = '/etc/xinetd.conf'
Expand All @@ -83,12 +83,12 @@
$service_status = undef
}
default: {
fail("xinetd: module does not support Linux operatingsystem ${::operatingsystem}")
fail("xinetd: module does not support Linux operatingsystem ${facts['os']['name']}")
}
}
}
default: {
fail("xinetd: module does not support osfamily ${::osfamily}")
fail("xinetd: module does not support osfamily ${facts['os']['family']}")
}
}

Expand Down
2 changes: 1 addition & 1 deletion manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
$redirect = undef,
) {

include ::xinetd
include xinetd

unless ($server or $redirect) {
fail('xinetd::service needs either of server or redirect')
Expand Down
10 changes: 5 additions & 5 deletions spec/classes/xinetd_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

context 'When using default values' do
let :facts do
{ :osfamily => 'Debian' }
{ operatingsystem: 'Debian', osfmaily: 'Debian', os: { 'family' => 'Debian' } }
end
it {
should contain_package('xinetd')
Expand Down Expand Up @@ -39,7 +39,7 @@

context 'When overriding the default vaules' do
let :facts do
{ :osfamily => 'Debian' }
{ operatingsystem: 'Debian', osfmaily: 'Debian', os: { 'family' => 'Debian' }}
end
let :params do
{ :enabled => 'tftp nrpe',
Expand Down Expand Up @@ -93,7 +93,7 @@

context 'with defaults on Linux' do
let :facts do
{ :osfamily => 'Debian' }
{ operatingsystem: 'Debian', osfmaily: 'Debian', os: { 'family' => 'Debian' } }
end
it {
should contain_package('xinetd')
Expand All @@ -105,7 +105,7 @@

context 'with defaults on FreeBSD' do
let :facts do
{ :osfamily => 'FreeBSD' }
{ operatingsystem: 'FreeBSD', osfmaily: 'FreeBSD', os: { 'family' => 'FreeBSD' } }
end
it {
should contain_package('security/xinetd')
Expand All @@ -117,7 +117,7 @@

context 'with managed confdir' do
let :facts do
{ :osfamily => 'Debian' }
{ operatingsystem: 'Debian', osfmaily: 'Debian', os: { 'family' => 'Debian' } }
end
let :params do
{ :purge_confdir => true }
Expand Down
4 changes: 2 additions & 2 deletions spec/defines/xinetd_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

describe "ensure proper user/group are set in FreeBSD" do
let :facts do
{ :osfamily => 'FreeBSD' }
{ operatingsystem: 'FreeBSD', osfamily: 'FreeBSD', os: { 'family' => 'FreeBSD' }}
end

let :params do
Expand All @@ -29,7 +29,7 @@
end

let :facts do
{ :osfamily => 'Debian' }
{ operatingsystem: 'Debian', osfamily: 'Debian', os: { 'family' => 'Debian' }}
end

describe 'with default ensure' do
Expand Down