Skip to content

Commit

Permalink
update CHANGELOG, rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rski committed May 11, 2016
1 parent 840c119 commit 8af7b1f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 36 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CHANGELOG

* Drop support for Ruby 1.8.7
* voxpupuli namespace release
* (#69) debian default route should now be named 'default', same as redhat

# Releasing 0.5.0

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/network_route/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def self.format_file(_filename, providers)
raise Puppet::Error, "#{provider.name} is missing the required parameter 'gateway'." if provider.gateway.nil?
raise Puppet::Error, "#{provider.name} is missing the required parameter 'interface'." if provider.interface.nil?

netmask = (provider.name =='default' ? '0.0.0.0': provider.netmask)
netmask = (provider.name == 'default' ? '0.0.0.0' : provider.netmask)

contents << "#{provider.network} #{netmask} #{provider.gateway} #{provider.interface}"
contents << (provider.options == :absent ? "\n" : " #{provider.options}\n")
Expand Down
12 changes: 4 additions & 8 deletions spec/unit/provider/network_config/interfaces_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ def fixture_data(file)
netmask: '255.255.0.0',
mtu: '1500',
mode: nil,
options: nil
)
options: nil)
end

let(:eth0_1_provider) do
Expand All @@ -183,8 +182,7 @@ def fixture_data(file)
netmask: '255.255.0.0',
mtu: '1500',
mode: :vlan,
options: nil
)
options: nil)
end

let(:eth1_provider) do
Expand All @@ -205,8 +203,7 @@ def fixture_data(file)
'/bin/touch /tmp/eth1-down1',
'/bin/touch /tmp/eth1-down2',
],
}
)
})
end

let(:lo_provider) do
Expand All @@ -220,8 +217,7 @@ def fixture_data(file)
netmask: nil,
mtu: '65536',
mode: nil,
options: nil
)
options: nil)
end

before do
Expand Down
16 changes: 5 additions & 11 deletions spec/unit/provider/network_config/redhat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,7 @@ def fixture_data(file)
netmask: '255.255.255.0',
mtu: '1500',
mode: nil,
options: { 'NM_CONTROLLED' => 'no', 'USERCTL' => 'no' }
)
options: { 'NM_CONTROLLED' => 'no', 'USERCTL' => 'no' })
end

let(:eth0_1_provider) do
Expand All @@ -372,8 +371,7 @@ def fixture_data(file)
netmask: '255.255.255.0',
mtu: '1500',
mode: :vlan,
options: { 'NM_CONTROLLED' => 'no', 'USERCTL' => 'no' }
)
options: { 'NM_CONTROLLED' => 'no', 'USERCTL' => 'no' })
end

let(:eth1_provider) do
Expand All @@ -388,8 +386,7 @@ def fixture_data(file)
netmask: :absent,
mtu: :absent,
mode: :vlan,
options: :absent,
)
options: :absent)
end

let(:lo_provider) do
Expand All @@ -402,8 +399,7 @@ def fixture_data(file)
ipaddress: nil,
netmask: nil,
mode: nil,
options: {}
)
options: {})
end

let(:bond0_provider) do
Expand All @@ -418,9 +414,7 @@ def fixture_data(file)
mode: nil,
options: {
'BONDING_OPTS' => %(mode=4 miimon=100 xmit_hash_policy=layer3+4)
}

)
})
end

it 'should fail if multiple interfaces are flushed to one file' do
Expand Down
12 changes: 4 additions & 8 deletions spec/unit/provider/network_route/redhat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ def fixture_data(file)
netmask: '30',
gateway: '172.18.6.2',
interface: 'vlan200',
options: 'table 200'
)
options: 'table 200')
end

let(:route2_provider) do
Expand All @@ -90,8 +89,7 @@ def fixture_data(file)
netmask: '30',
gateway: '172.18.6.2',
interface: 'eth0',
options: 'table 200'
)
options: 'table 200')
end

let(:defaultroute_provider) do
Expand All @@ -101,8 +99,7 @@ def fixture_data(file)
netmask: '',
gateway: '10.0.0.1',
interface: 'eth1',
options: 'table 200'
)
options: 'table 200')
end

let(:nooptions_provider) do
Expand All @@ -112,8 +109,7 @@ def fixture_data(file)
netmask: '',
gateway: '10.0.0.1',
interface: 'eth2',
options: :absent
)
options: :absent)
end

let(:content) { described_class.format_file('', [route1_provider, route2_provider, defaultroute_provider, nooptions_provider]) }
Expand Down
12 changes: 4 additions & 8 deletions spec/unit/provider/network_route/routes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ def fixture_data(file)
netmask: '255.255.255.0',
gateway: '172.18.6.2',
interface: 'vlan200',
options: 'table 200'
)
options: 'table 200')
end

let(:route2_provider) do
Expand All @@ -97,8 +96,7 @@ def fixture_data(file)
netmask: '255.255.255.0',
gateway: '172.18.6.2',
interface: 'eth0',
options: 'table 200'
)
options: 'table 200')
end

let(:content) { described_class.format_file('', [route1_provider, route2_provider]) }
Expand Down Expand Up @@ -134,8 +132,7 @@ def fixture_data(file)
netmask: '255.255.255.0',
gateway: '172.18.6.2',
interface: 'vlan200',
options: :absent,
)
options: :absent)
end

let(:route2_provider) do
Expand All @@ -145,8 +142,7 @@ def fixture_data(file)
netmask: '255.255.255.0',
gateway: '172.18.6.2',
interface: 'eth0',
options: :absent,
)
options: :absent)
end

let(:content) { described_class.format_file('', [route1_provider, route2_provider]) }
Expand Down

0 comments on commit 8af7b1f

Please sign in to comment.