Skip to content

Commit

Permalink
Allow empty string for release in apt::source
Browse files Browse the repository at this point in the history
This fixes a regression from commit 0a178c3.

Some repos don't have a release. This allows using such repos.

Tests added to make sure when release is set to an empty string the
source file is rendered correctly.

All other tests are passing.
  • Loading branch information
tomduckering authored and Helen Campbell committed May 26, 2017
1 parent 03baf34 commit 8c65cff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions manifests/source.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Optional[String] $location = undef,
String $comment = $name,
String $ensure = present,
Optional[String] $release = undef,
Optional[String] $release = 'UNDEF',
String $repos = 'main',
Optional[Variant[Hash]] $include = {},
Optional[Variant[String, Hash]] $key = undef,
Expand All @@ -19,7 +19,7 @@

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

if ! $release {
if $release == 'UNDEF' {
if $facts['lsbdistcodename'] {
$_release = $facts['lsbdistcodename']
} else {
Expand Down
3 changes: 2 additions & 1 deletion spec/defines/source_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,8 @@
context 'release is empty string' do
let :facts do
{
:lsbdistid => 'Debian',
:os => { :family => 'Debian', :name => 'Debian', :release => { :major => '7', :full => '7.0' }},
:lsbdistid => 'Debian',
:osfamily => 'Debian',
:puppetversion => Puppet.version,
}
Expand Down

0 comments on commit 8c65cff

Please sign in to comment.