Project

General

Profile

« Previous | Next » 

Revision b1503c75

Added by Ewoud Kohl van Wijngaarden over 9 years ago

Allow empty range parameter

When a user would pass an empty range parameter, it would result into

pool {
range ;
}

dhcpd would fail to start after that. With this patch, the whole pool
block is omitted.

Closes GH-29

View differences:

spec/defines/pool_spec.rb
}
end
describe 'with empty string range' do
let :params do {
:network => '10.0.0.0',
:mask => '255.255.255.0',
:range => '',
} end
it {
content = subject.resource('concat_fragment', 'dhcp.conf+70_mypool.dhcp').send(:parameters)[:content]
content.split("\n").reject { |c| c =~ /(^\s*#|^$)/ }.should == [
"subnet 10.0.0.0 netmask 255.255.255.0 {",
" option subnet-mask 255.255.255.0;",
"}",
]
}
end
describe 'full parameters' do
let :params do {
:network => '10.0.0.0',

Also available in: Unified diff