Skip to content

Commit

Permalink
Merge pull request #681 from HelenCampbell/emptystringing
Browse files Browse the repository at this point in the history
Ensure release allows empty strings
  • Loading branch information
eputnam authored May 30, 2017
2 parents bb82b88 + cd15d61 commit 61f4e6a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/source.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

$_before = Apt::Setting["list-${title}"]

if ! $release {
if !$release {
if $facts['lsbdistcodename'] {
$_release = $facts['lsbdistcodename']
} else {
Expand Down
14 changes: 14 additions & 0 deletions spec/defines/source_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,20 @@
end
end

context 'release is empty string' do
let :facts do
{
:os => { :family => 'Debian', :name => 'Debian', :release => { :major => '7', :full => '7.0' }},
:lsbdistid => 'Debian',
:osfamily => 'Debian',
:puppetversion => Puppet.version,
}
end
let(:params) { { :location => 'hello.there', :release => '' } }

it { is_expected.to contain_apt__setting('list-my_source').with_content(/hello\.there main/) }
end

context 'invalid pin' do
let :facts do
{
Expand Down

0 comments on commit 61f4e6a

Please sign in to comment.