Skip to content

Commit 4985aaa

Browse files
committed
fix: replace legacy facst in providers
also add acceptance tests for network_route which should catch something like this in the future Refs: #348
1 parent b78457f commit 4985aaa

File tree

9 files changed

+43
-12
lines changed

9 files changed

+43
-12
lines changed

.sync.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ Gemfile:
77
':test':
88
- gem: 'ipaddress'
99
- gem: 'rspec-its'
10+
spec/spec_helper_acceptance.rb:
11+
unmanaged: false

lib/puppet/provider/network_config/interfaces.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
desc 'Debian interfaces style provider'
1515

16-
confine osfamily: :debian
17-
defaultfor osfamily: :debian
16+
confine 'os.family' => :debian
17+
defaultfor 'os.family' => :debian
1818

1919
has_feature :provider_options
2020
has_feature :hotpluggable

lib/puppet/provider/network_config/redhat.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
desc 'Redhat network-scripts provider'
1414

15-
confine osfamily: :redhat
16-
defaultfor osfamily: :redhat
15+
confine 'os.family' => :redhat
16+
defaultfor 'os.family' => :redhat
1717

1818
has_feature :hotpluggable
1919
has_feature :provider_options

lib/puppet/provider/network_config/sles.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
desc 'SLES network-scripts provider'
1414

15-
confine osfamily: :suse
16-
defaultfor osfamily: :suse
15+
confine 'os.family' => :suse
16+
defaultfor 'os.family' => :suse
1717

1818
has_feature :startmode
1919
has_feature :provider_options

lib/puppet/provider/network_route/redhat.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
desc 'RHEL style routes provider'
1515

16-
confine osfamily: :redhat
17-
defaultfor osfamily: :redhat
16+
confine 'os.family' => :redhat
17+
defaultfor 'os.family' => :redhat
1818

1919
has_feature :provider_options
2020

lib/puppet/provider/network_route/routes.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515
desc 'Debian routes style provider'
1616

17-
confine osfamily: :debian
17+
confine 'os.family' => :debian
1818

1919
# $ dpkg -S /etc/network/if-up.d/20static-routes
2020
# ifupdown-extra: /etc/network/if-up.d/20static-routes
2121
confine exists: '/etc/network/if-up.d/20static-routes'
2222

23-
defaultfor osfamily: :debian
23+
defaultfor 'os.family' => :debian
2424

2525
has_feature :provider_options
2626

lib/puppet/provider/network_route/sles.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
desc 'SLES style routes provider'
1515

16-
confine osfamily: :suse
17-
defaultfor osfamily: :suse
16+
confine 'os.family' => :suse
17+
defaultfor 'os.family' => :suse
1818

1919
has_feature :provider_options
2020

spec/acceptance/network_route_spec.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# frozen_string_literal: true
2+
3+
require 'spec_helper_acceptance'
4+
5+
describe 'network_route' do
6+
it 'is able to select a route provider' do
7+
pp = <<-EOS
8+
include network
9+
network_route { '127.0.0.2/32':
10+
ensure => 'present',
11+
gateway => '127.0.0.1',
12+
interface => 'lo',
13+
netmask => '255.255.255.255',
14+
}
15+
EOS
16+
# Run it twice and test for idempotency
17+
apply_manifest(pp, catch_failures: true)
18+
end
19+
end

spec/spec_helper_acceptance.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
# Managed by modulesync - DO NOT EDIT
4+
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
5+
6+
require 'voxpupuli/acceptance/spec_helper_acceptance'
7+
8+
configure_beaker(modules: :metadata)
9+
10+
Dir['./spec/support/acceptance/**/*.rb'].sort.each { |f| require f }

0 commit comments

Comments
 (0)